-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster listen doesn't resolve UNIX domain socket paths relative to worker CWD #16387
Comments
Yes, this sounds like a bug, thanks for reporting. One thing that makes this tricky: There is a pretty short path limit (~100 bytes) on what can be passed to |
We could call |
Relative unix sockets paths were previously interpreted relative to the master's CWD, which was inconsistent with non-cluster behavior. A test case has been added as well. Fixes: nodejs#16387
Relative unix sockets paths were previously interpreted relative to the master's CWD, which was inconsistent with non-cluster behavior. A test case has been added as well. PR-URL: #16749 Fixes: #16387 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Relative unix sockets paths were previously interpreted relative to the master's CWD, which was inconsistent with non-cluster behavior. A test case has been added as well. PR-URL: #16749 Fixes: #16387 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
When calling
server.listen('./socket.sock')
in a worker, the relative path is passed as-is to the master,causing the path to be relative to the master's CWD, instead of the child process' CWD.
This behavior is inconsistent with
listen(...)
outside of a worker.Here's a short example illustrating the issue:
Expected outcome:
test.sock
is created in/tmp
.Actual outcome:
test.sock
is created in the previous directory.Solution:
UNIX domain socket paths should immediately be resolved to absolute paths using
path.resolve(...)
before anything else is done with them (such as passing them to the master process).
The text was updated successfully, but these errors were encountered: