When to delete event timers

Valentin V. Bartenev vbart at nginx.com
Tue Aug 14 17:36:12 UTC 2018

On Tuesday 14 August 2018 18:15:26 Antonio Nappa wrote:
> Hello,
> I have a module which registers several events and I am using Nginx 1.12.1,
> it looks like when I do a reload that the worker(s) hang and with the help
> of strace I see that the events hanging are my events. I have added a
> function on process exit but it does not get called (probably because of
> the pending events). So my question is when should I delete the timers if
> not on process exit?

If you don't want your timer to delay process exit, there's "cancelable" flag:


 | cancelable — Timer event flag indicating that the event should be ignored
 | while shutting down the worker. Graceful worker shutdown is delayed until 
 | here are no non-cancelable timer events scheduled. 

  wbr, Valentin V. Bartnev

More information about the nginx-devel mailing list