[Kimchi-devel] [RFC] [Wok] Issue 141 - Track asynchronous tasks in user request log

Aline Manera alinefm at linux.vnet.ibm.com
Mon Aug 22 18:29:43 UTC 2016



On 08/22/2016 02:39 PM, Lucio Correia wrote:
> On 22-08-2016 13:52, Aline Manera wrote:
>> Hi Lucio,
>
> Hi,
>
>>
>> Task is an internal mechanism to Wok and its plugins execute long time
>> processing. So that is not part of user knowledge.
> User log functionality is for admins, not regular users, right?

Correct. But even though an admin does not know how the backend works. 
He/she only wants to know which actions were taken in the system.

>
>> Adding a log record as Task will make the user confused IMO.
>
> I don't think so, have you seen my patches running? I've changed the 
> UI too. It's pretty clear IMHO.
>

No! I am concerned about the backend part by now.

>>
>> So my proposal is: when the Task is started in the backend, add a log
>> record and set its status as 'pending'
>> Once the Task is completed (with success or not), change the log record
>> to success or failure according to what happened there.
>>
>> To do that you will need to find a way to query a log entry in the JSON
>> file and edit/replace it to the updated entry.
>>
>> What do you think about it?
>
> To do that we will also need to differentiate in wok/control/base.py 
> the type of request (if it generates task or not) and I tried to avoid 
> that with my design.
>

It is already done in the control/base.py.

Look for generate_action_handler_task() function in control/base.py
All the actions which rely on Task are done by this function.

> Also, I believe the way I proposed to do it makes it more clear for 
> the guy debugging through logs what's happening behind the scenes.
>

This feature is not for debug! It is for an admin identifies which 
actions were taken in the system in a visual way.

> So, IMHO, it will increase code complexity to differentiate tasks 
> through some variable, handle it in base.py, code for changing log 
> entries, for no real gain.
>
>
>>
>> Regards,
>> Aline Manera
>>
>
> Regards,
>




More information about the Kimchi-devel mailing list