Skip to content

Fix a race in epmd#11085

Open
pguyot wants to merge 1 commit into
erlang:masterfrom
pguyot:w18/fix-epmd-race
Open

Fix a race in epmd#11085
pguyot wants to merge 1 commit into
erlang:masterfrom
pguyot:w18/fix-epmd-race

Conversation

@pguyot
Copy link
Copy Markdown
Contributor

@pguyot pguyot commented May 2, 2026

There is a race where a node can unregister and reregister too fast for epmd to notice as FIN is not processed yet. Handle this by checking if the socket from the other registered node with the same name is being closed.

Fixes #11083

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

CT Test Results

  2 files   12 suites   6m 46s ⏱️
129 tests 123 ✅ 6 💤 0 ❌
145 runs  139 ✅ 6 💤 0 ❌

Results for commit 236b265.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label May 4, 2026
Copy link
Copy Markdown
Contributor

@jhogberg jhogberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, and sorry about the delay, I added a comment but it got stuck in "pending" :(

I'll add it to the nightly builds as soon as CI will pass.

Comment thread erts/epmd/src/epmd_srv.c Outdated
for (node = g->nodes.reg; node; node = node->next)
if (is_same_str(node->symname, name))
{
fd_set rfds;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: indentation must use spaces these days, our CI checks for whitespace errors now.

Suggested change
fd_set rfds;
fd_set rfds;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detabbed my changes. FYI the rest of the file still uses tabs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the CI checks only changed lines for now. :)

There is a race where a node can unregister and reregister too fast for
epmd to notice as FIN is not processed yet. Handle this by checking if the
socket from the other registered node with the same name is being closed.

Fixes erlang#11083

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w18/fix-epmd-race branch from 99013e4 to 236b265 Compare May 8, 2026 07:19
@jhogberg jhogberg added the testing currently being tested, tag is used by OTP internal CI label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net_kernel:start/stop cycles race against epmd's FIN processing

3 participants