Hello!
On Tue, May 31, 2016 at 11:28 AM, Suchit Puri wrote:
> Hi AgentZH,
>
Please do not use upper case letters in my nick. Thank you.
> We really need some help here, we have been trying to upgrade openresty to
> version ~ 1.9 as it has http2 support and makes our CDN faster.
>
Can you reproduce it with HTTP2 disabled? Wondering if it's related to
the HTTP2 implementation in the nginx core.
> The issue is whenever we reload the openresty we are left with 2 dangling
> worker processes stuck in "worker process is shutting down" state, They
> never die down.
>
One way to directly inspect the shutting-down worker processes is to
use GDB to check what timers are pending. You can check the timer
handler pointer to find out what parts of the nginx/openresty are
responsible for such dangling timers.
FYI, the nginx core uses the following code for a worker process to
test whether it can shutdown safely:
if (ngx_exiting) {
ngx_event_cancel_timers();
if (ngx_event_timer_rbtree.root == ngx_event_timer_rbtree.sentinel)
{
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
ngx_worker_process_exit(cycle);
}
}
It's in the ngx_worker_process_cycle C function defined in the file
src/os/unix/ngx_process_cycle.c.
You can also check out the ngx_event_cancel_timers C function for an
example of iterating through the redblack tree for pending timers.
Best regards,
-agentzh