Welcome! Log In Create A New Profile

Advanced

Re: [nginx] Introduced worker_shutdown_timeout.

Maxim Dounin
March 09, 2017 07:30AM
Hello!

On Thu, Mar 09, 2017 at 02:39:26PM +0800, 洪志道 wrote:

[...]

> "Cancelable timers are now preserved if there are other timers. There is no
> need to cancel timers early if there are other timers blocking shutdown
> anyway. Preserving such timers allows nginx to continue some periodic work
> till the shutdown is actually possible. With the new approach, timers with
> ev->cancelable are simply ignored when checking if there are any timers
> left during shutdown."
>
> But how to do the timers those are cancelable such as buffer-event in log
> module.
> When the worker process is shutting down, they lose the chance to do
> registered handler.
> Even so the log module also works well because of 'ngx_conf_flush_files'.

Cancelable timers are expected to do it's work normally until the
actual shutdown is possible, but will not delay shutdown.

You can't relay on them to do any cleanup work though, as they
will not be called in many cases. For example, much like any
other timers they will not be called on fast shutdown (aka
ngx_terminate). To do a cleanup work you should use cleanup
handlers and/or exit_process callbacks.

In particular, the log module uses cancelable timers to do
periodic flushes while the process is still running. The final
flush will be done on the process exit in the
ngx_conf_flush_files() exit_process callback.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Introduced worker_shutdown_timeout.

Maxim Dounin 928 March 07, 2017 12:02PM

Re: [nginx] Introduced worker_shutdown_timeout.

Maxim Dounin 1322 March 09, 2017 07:18AM

Re: [nginx] Introduced worker_shutdown_timeout.

Maxim Dounin 482 March 09, 2017 07:30AM

Re: [nginx] Introduced worker_shutdown_timeout.

karton 416 March 09, 2017 07:54AM

Re: [nginx] Introduced worker_shutdown_timeout.

karton 437 March 09, 2017 07:54AM

Re: [nginx] Introduced worker_shutdown_timeout.

karton 622 March 09, 2017 08:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready