> On 14 January 2013 20:38, demerphq <[email protected]> wrote:
>> On 14 January 2013 20:30, Roberto De Ioris <[email protected]> wrote:
>>>> As far as I can tell this solution will have the same problem. END{}
>>>> blocks are not executed due to a termination triggered by a signal.
>>>>
>>>> <quote>
>>>> It is important to note that END{} blocks and object destruction only
>>>> get called on normal termination (which includes calls to die or
>>>> Carp::croak). They do not get called when the program terminates
>>>> abnormally (due to a signal for example) unless special arrangements
>>>> have been made by the programmer (e.g. using a signal handler -- see
>>>> "%SIG{expr}" in perlvar).
>>>> </quote>
>>>>
>>>> Since uWSGI seems to not support passing such signals to the worker
>>>> process it seems to me that we are back to the same problem.
>>>
>>> I was sure AtExit would make use of the C atexit() function.
>>
>> Yeah, I can imagine. I just checked again, and it is pure perl so I
>> dont think so.
>>
>>> By the way this is not a big problem, the plugin api already has the
>>> ability to run hooks on shutdown/reload, it is a matter of 4-5 lines of
>>> C.
>>> I think i will be able to release a patch tomorrow.
>
> Hi Roberto, I see you havent released yet, no doubt you are busy. :-)
>
> Is there anything I can do to help out with this? I'd be happy to
> contribute a patch if you point me at the right place to look.
>
> Cheers,
> Yves
>

Check that commit (backported from 1.5)


https://github.com/unbit/uwsgi/commit/1cbab74f0e623ed80e7992c8f34c5e6fc756391e

it adds uwsgi::postfork and uwsgi::atexit

In the test.psgi file there is an example usage (basically you pass a
function reference)

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to