Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@potatosalad
Copy link
Contributor

@potatosalad potatosalad commented Oct 23, 2025

Potential fix for #10322

If I'm understanding what happens when scheduler pollset migration gets triggered: once the state->count++ > 10, we migrate the "hot fd" to the scheduler pollset.

However, the state->count++ is global, so if there are multiple processes all calling socket:accept at the same time, then state->count++ > 10 could be triggered almost immediately.

For things like socket:recv, this generally would work as expected since there is typically one process calling this in a loop.

However, for socket:accept, it's more of a common practice to have multiple processes all trying to accept inbound connections.

If all of that's correct, then this is my assumption:

  • OTP 27: Direct message delivery from the I/O thread(?)
  • OTP 28: Process signals, sent from the normal scheduler thread(?)

The change here is to add a state->last_select_pid field and reset the state->count = 0 if we detect that the process has changed between calls to enif_select.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

CT Test Results

    3 files    135 suites   48m 46s ⏱️
1 654 tests 1 597 ✅ 57 💤 0 ❌
2 292 runs  2 216 ✅ 76 💤 0 ❌

Results for commit 35ad26a.

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

@potatosalad potatosalad marked this pull request as ready for review October 23, 2025 20:45
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Oct 27, 2025
@sverker sverker self-assigned this Oct 27, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants