Pull request just opened.
https://github.com/unbit/uwsgi/pull/332

While I was there, I also added a few lines of comments, from my own
learnings by reading the code.
Hope everything's fine.

*Alberto Scotto*

skype:dasgazzo
http://about.me/alb_i986


2013/7/3 Alberto Scotto <[email protected]>

> After quite a long studying (*too many* comments in your code to read,
> man! :P)..
> ..I got it!
>
> I just had to extend the test that checks whether mtime has changed,
> making it check also the mtime of the symbolic link (having saved it before
> in lst.st_mtime).
>
> // check if mtime is changed and the uWSGI instance must be reloaded
> // handles also the case 'touch --no-dereference $INIFILE' to reload only
> one instance
> if (st.st_mtime > ui_current->last_mod || lst.st_mtime >
> ui_current->last_mod) {
>  time_t new_mtime = lst.st_mtime >= st.st_mtime ? lst.st_mtime :
> st.st_mtime;
> emperor_respawn(ui_current, new_mtime);
> }
> [emperor.c:279-281<https://github.com/unbit/uwsgi/blob/master/core/emperor.c#L279>
> ]
>
> Tested and it's working.
>
> I have to finish the patch following what you touched in your 
> commit<https://github.com/unbit/uwsgi/commit/ff8ca18e8f3bb402a99c4392c263a9eb3b397907>
>
> Please Roberto give me some feedback if I'm on a good path and can proceed.
> Thank you
>
>
> *Alberto Scotto*
>
> skype:dasgazzo
> http://about.me/alb_i986
>
>
> 2013/7/3 Alberto Scotto <[email protected]>
>
>> Fair enough.
>>
>> But listen.
>>
>> What if the system (without any '--emperor-nofollow') was able to handle
>> both
>> 1. touch $INIFILE
>> 2. touch --no-dereference $INIFILE
>> (where $INIFILE is a symbolic link to $SKELFILE, of course)
>> so that:
>> 1) would reload all the instances linking to $SKELFILE
>> 2) would reload only the single instance
>>
>>  In other terms, the system should monitor the mtime of both the files
>> (link and physical).
>>
>> And backward compatibility is safe! :)
>>
>> Is it all right until here?
>>
>> Now the question is how much effort it is required by implementing such a
>> change.
>> I'm trying to study the thing myself, reading emperor.c, any hints are
>> welcome
>>
>> *Alberto Scotto*
>>
>> skype:dasgazzo
>> http://about.me/alb_i986
>>
>>
>> 2013/7/2 Roberto De Ioris <[email protected]>
>>
>>>
>>> > Tested: seems great, thank you!
>>> >
>>> > So now
>>> >
>>> > *touch --no-dereference $INI_FILE*
>>> >
>>> > does the job.
>>> >
>>> > Do you think you will keep '--emperor-nofollow' as a separate option or
>>> > you'll make it the default?
>>> >
>>>
>>> Unless something is seriously wrong we cannot change defaults :)
>>>
>>> touching a single template file for reloading dozens of apps in one shot
>>> is a common pattern :)
>>>
>>> --
>>> Roberto De Ioris
>>> http://unbit.it
>>> _______________________________________________
>>> uWSGI mailing list
>>> [email protected]
>>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>>
>>
>>
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to