-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Update PipeWrap to use uv_pipe_bind2 and uv_pipe_connect2 to restore ability to connect to abstract domain sockets #49667
Conversation
Alright, here we go @santigimeno. I think I got the commit message guidelines down. Looking for feedback on the test. It should do the thing but might not be at the peak of elegance or codebase best practices. Also, since I'm expecting to make changes; is rebasing ok or do we prefer new fix commits for review purposes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looking good. Left some comments. Also a good idea is for you to test if the linter passes: make lint
.
@santigimeno turns out the guide you linked has almost exactly the test I wanted. I added an extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT with lint issues fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work!
Ugh, copy paste mistake. Fixing. |
The introduction of the uv_pipe_bind2 and uv_pipe_connect2 methods in libuv v1.46.0 changed the behaviour of uv_pipe_bind and uv_pipe_connect. This broke the ability to connect to abstract domain sockets on linux. This change ports PipeWrap to use the new uv_pipe_bind2 and uv_pipe_connect2 methods to restore abstract domain socket support. Fixes: nodejs#49656 Refs: libuv/libuv#4030
Introduce a new linux-only test for binding to an abstract unix socket and then making an http request against that socket. Refs: nodejs#49656
Seems like the |
Looks unrelated will restart ci |
Landed in 553169f |
Thank you for your contribution @ggoodman 🚀 |
The introduction of the uv_pipe_bind2 and uv_pipe_connect2 methods in libuv v1.46.0 changed the behaviour of uv_pipe_bind and uv_pipe_connect. This broke the ability to connect to abstract domain sockets on linux. This change ports PipeWrap to use the new uv_pipe_bind2 and uv_pipe_connect2 methods to restore abstract domain socket support. Fixes: #49656 Refs: libuv/libuv#4030 PR-URL: #49667 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
The introduction of the uv_pipe_bind2 and uv_pipe_connect2 methods in libuv v1.46.0 changed the behaviour of uv_pipe_bind and uv_pipe_connect. This broke the ability to connect to abstract domain sockets on linux. This change ports PipeWrap to use the new uv_pipe_bind2 and uv_pipe_connect2 methods to restore abstract domain socket support. Fixes: nodejs#49656 Refs: libuv/libuv#4030 PR-URL: nodejs#49667 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
We need to handle errors from uv_pipe_connect2() because return type is `int`. Fixes: nodejs#50652 Refs: nodejs#49667 Refs: libuv/libuv#4030
We need to handle errors from uv_pipe_connect2() because return type is `int`. Fixes: nodejs#50652 Refs: nodejs#49667 Refs: libuv/libuv#4030
We need to handle errors from uv_pipe_connect2() because return type is `int`. Fixes: #50652 Refs: #49667 Refs: libuv/libuv#4030 PR-URL: #50657 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: theanarkh <[email protected]>
We need to handle errors from uv_pipe_connect2() because return type is `int`. Fixes: #50652 Refs: #49667 Refs: libuv/libuv#4030 PR-URL: #50657 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: theanarkh <[email protected]>
PR-URL: #50904 Refs: #49667 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
PR-URL: #50904 Refs: #49667 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
We need to handle errors from uv_pipe_connect2() because return type is `int`. Fixes: #50652 Refs: #49667 Refs: libuv/libuv#4030 PR-URL: #50657 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: theanarkh <[email protected]>
PR-URL: #50904 Refs: #49667 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
This PR moves
PipeWrap
from the classicuv_pipe_bind
anduv_pipe_connect
methods to their neweruv_pipe_bind2
anduv_pipe_connect2
counterparts. This restores support for connecting to abstract unix domain sockets. Support was lost due to the refactor in libuv/libuv#4030 whereuv_pipe_bind
anduv_pipe_connect
now infer the length of thepathname
usingstrlen()
. For an abstract unix socket, this was producing0
. Moving touv_pipe_bind2
anduv_pipe_connect2
allows us to pass an explicitsize_t
for the socket path based on the length of the v8 string.Fixes: #49656