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
The net_kernel:setopts call can deadlock the net_kernel process. #6129
Labels
Comments
Thanks for the detailed bug report! Yes, this bug has existed since the introduction of the |
rickard-green
added a commit
to rickard-green/otp
that referenced
this issue
Aug 11, 2022
…-18198' into rickard/net_kernel-setopts-fix/24.3.4/erlangGH-6129/OTP-18198 * rickard/net_kernel-setopts-fix/23.3.4/erlangGH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
rickard-green
added a commit
to rickard-green/otp
that referenced
this issue
Aug 11, 2022
…-18198' into rickard/net_kernel-setopts-fix/25.0.3/erlangGH-6129/OTP-18198 * rickard/net_kernel-setopts-fix/24.3.4/erlangGH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
The PR #6216 should fix this issue (not very well tested yet, though). Unless something unexpected happens it will be part of the next patch. |
rickard-green
added a commit
that referenced
this issue
Aug 15, 2022
…' into maint * rickard/net_kernel-setopts-fix/25.0.3/GH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
lthor
pushed a commit
that referenced
this issue
Aug 18, 2022
…' into maint-24 * rickard/net_kernel-setopts-fix/24.3.4/GH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
rickard-green
pushed a commit
that referenced
this issue
Aug 18, 2022
…' into maint-25 * rickard/net_kernel-setopts-fix/25.0.3/GH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
Fixed in patches OTP 25.0.4 and OTP 24.3.4.3 which we released today. |
Awesome. Thank you very much :) |
kikofernandez
pushed a commit
that referenced
this issue
Sep 5, 2022
…' into maint-23 * rickard/net_kernel-setopts-fix/23.3.4/GH-6129/OTP-18198: [kernel] Fix deadlock caused by net_kernel:setopts(new, _)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The
net_kernel:setopts(new, ...)
can deadlock thenet_kernel
process permanently. This happens if the call is made concurrently with an incoming dist connection handshake.To Reproduce
With the official docker container:
In another shell in the container:
The
erl_call
loop quickly gets stuck and the node no longer accepts dist connections.Affected versions
We've seen this in our code on R22, and I've tried 24 and 25 with same result. Bug probably was there since
setopts
was introduced?Additional context
I think what happens is that
net_kernel:setopts_new_1/1
is calling into pending connections. The incoming one is pending (doing handshake), but at the end of the handshake it calls intonet_kernel
(dist_util:mark_nodeup/2
), so it's a deadlock.For completeness, here's the process_info and backtrace of
net_kernel
:The incoming connection's backtrace:
The text was updated successfully, but these errors were encountered: