bugfix: solve the problem that the worker process cannot exit in time#70
bugfix: solve the problem that the worker process cannot exit in time#70weeweetan wants to merge 2 commits intointel:masterfrom
Conversation
|
Thanks for your contribution, we will confirm this issue as soon as possible. |
|
Hi weeweetan, There is a test scenario that will fail after using your patch - Nginx reload with new connections creating. Here are my testing steps
|
|
Because when checking timers in function ngx_event_no_timers_left |
|
Hello, is the shutting down status never exited? I tested it here. After reloading, it completely exited in about 1 minute. According to the gdb information you provided, the shutting down worker is still processing connections. I think this is in line with expectations because reload exits gracefully and the worker will wait for all request processing to be completed. |
|
Hi, I tested this case because I found this issue raised several years ago, that is why we added the code. |
If other modules have registered some timers with long intervals, and cancelable is set to 1, after reload, ngx_event_timer_rbtree.root != ngx_event_timer_rbtree.sentinel will always be true and the poll event must be added to the timer every time. I think There is no need to wait for the timer tree to clear. When the worker exits, there should be no more events registered.