Skip to content

Conversation

@michalmuskala
Copy link
Contributor

Currently, for every registered process there's a potential race condition where when the process terminates, the supervisor can restart it before the registry processes the DOWN message.
This isn't possible to avoid in all situations, but for servers that trap_exit and process terminate calls, this is entirely possible.

This change implements this adding a call to gen:unregister_name just after users terminate callback is processed.

Currently, for every registered process there's a potential race condition
where when the process terminates, the supervisor can restart it before
the registry processes the DOWN message.
This isn't possible to avoid in all situations, but for servers that
trap_exit and process `terminate` calls, this is entirely possible.

This change implements this adding a call to `gen:unregister_name`
just after users `terminate` callback is processed.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

CT Test Results

    2 files     97 suites   1h 4m 51s ⏱️
2 215 tests 2 163 ✅ 52 💤 0 ❌
2 601 runs  2 545 ✅ 56 💤 0 ❌

Results for commit 83e8109.

♻️ 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

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label Oct 20, 2025
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants