Max Romanov 0ec69aa46e Libunit: fixing racing condition for port add / state change.
The issue only occurred in Go applications because "port_send" is overloaded
only in Go.  To reproduce it, send multiple concurrent requests to the
application after it has initialised.  The warning message "[unit] [go] port
NNN:dd not found" is the first visible aspect of the issue; the second and more
valuable one is a closed connection, an error response, or a hanging response to
some requests.

When the application starts, it is unaware of the router's worker thread ports,
so it requests the ports from the router after receiving requests from the
corresponding router worker threads.  When multiple requests are processed
simultaneously, the router port may be required by several requests, so request
processing starts only after the application receives the required port
information.  The port should be added to the Go port repository after its
'ready' flag is updated.  Otherwise, Unit may start processing some requests and
use the port before it is in the repository.

The issue was introduced in changeset 78836321a126.
2020-11-18 22:33:53 +03:00
2020-09-18 19:37:56 +01:00
2017-09-06 18:26:37 +03:00
2020-01-27 16:52:45 +03:00
2020-10-13 01:37:39 +03:00

NGINX Unit
----------

The documentation and binary packages are available online:

  http://unit.nginx.org

The source code is provided under the terms of Apache License 2.0:

  http://hg.nginx.org/unit

Please ask questions, report issues, and send patches to the mailing list:

  unit@nginx.org (http://mailman.nginx.org/mailman/listinfo/unit)

or via Github:

  https://github.com/nginx/unit

--
NGINX, Inc.
http://nginx.com

Description
No description provided
Readme 12 MiB
Languages
Shell 63.7%
HTML 36.3%