Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fixed state protection when restarting during the websocket request process

Maxim Dounin
December 20, 2022 03:04AM
Hello!

On Tue, Dec 20, 2022 at 03:01:59PM +0800, 乔志奇 wrote:

> # HG changeset patch
> # User 乔志奇@Matebook-Qiao <qiaozhiqi2016@gmail.com>
> # Date 1671515941 -28800
> # Tue Dec 20 13:59:01 2022 +0800
> # Branch nginx-bugfix-websocket
> # Node ID 3e68435db4a9991921b5bf91d792787a1ad387fb
> # Parent 3108d4d668e4b907868b815f0441d4c893bf4188
> Fixed state protection when restarting during the websocket request process
>
> During the websocket request process, it is necessary to add a timer
> operation, but we need to do state protection for the timer addition
> operation. When the nginx process is restarted or stopped, the timer should
> be prohibited from being added, otherwise continuous websocket requests
> will cause the old process to be unable to exit during the restart process
> or unable to exit during the stop process.

Thanks, but no.

The graceful exit process is expected to handle all existing
connections till they are closed normally. This includes
Websocket connections.

The recommended approach for long-running connections (including
Websocket, stream module connections, or just long-running HTTP
requests) is to close them periodically from the server side, so
they can be properly re-established without errors.

If this does not work for you for some reason (for example, if you
cannot control the behaviour of the backend server), consider
using the "worker_shutdown_timeout" directive
(http://nginx.org/r/worker_shutdown_timeout) to terminate all
connections after certain period of time.

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

[PATCH] Fixed state protection when restarting during the websocket request process

乔志奇 420 December 20, 2022 02:04AM

Re: [PATCH] Fixed state protection when restarting during the websocket request process

Maxim Dounin 101 December 20, 2022 03:04AM

Re: [PATCH] Fixed state protection when restarting during the websocket request process

乔志奇 134 December 26, 2022 02:04AM



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

Online Users

Guests: 168
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