You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If the server configuration includes the "unix" parameter to specify the path to a unix socket to open in the server, the socket is opened in the parent process but then not passed as the "sock" parameter to the worker processes.
Code snippet
Relevant source code, make sure to remove what is not necessary.
Expected behavior
Passing the unix parameter should result in the socket being opened in the parent process and then passed as an open file descriptor using the "sock" parameter to workers just like TCP/IP sockets are passed.
Environment (please complete the following information):
OS: Ubuntu linix
22
Additional context
I believe it is simply a matter of a missing line here:
Thanks @ahopkins . As a bit of additional information, the side effect that caused me to notice this is that when I run with multiple workers over a unix socket, all of the requests go to a single worker. The other workers just sit idle. This is because each worker winds up trying to itself open the unix path, and so overwriting each other and only the last worker has an actual open socket that the operating system knows about.
The workaround I am using is to manually open the unix socket and pass that socket (rather than the unix path) to the app.run method.
Describe the bug
If the server configuration includes the "unix" parameter to specify the path to a unix socket to open in the server, the socket is opened in the parent process but then not passed as the "sock" parameter to the worker processes.
Code snippet
Relevant source code, make sure to remove what is not necessary.
Expected behavior
Passing the unix parameter should result in the socket being opened in the parent process and then passed as an open file descriptor using the "sock" parameter to workers just like TCP/IP sockets are passed.
Environment (please complete the following information):
Additional context
I believe it is simply a matter of a missing line here:
sanic/sanic/server/runners.py
Line 237 in 4ee2e57
of doing the same thing that the TCP case does
The text was updated successfully, but these errors were encountered: