Skip to content

state_exec: a coordinator acts only on its own node's control and migrate messages (CB-2) - #1186

Merged
transfix merged 4 commits into
masterfrom
fix/coordinator-own-node
Nov 13, 2026
Merged

transfix merged 4 commits into
masterfrom
fix/coordinator-own-node

Conversation

@transfix

Copy link
Copy Markdown
Owner

A coordinator subscribes to the whole __state_exec prefix (exec_coordinator.cpp:289), so on a bus several nodes share it saw every node's control.<node> and migrate.<node> messages and acted on them:

  • handle_control posted every command to its own scheduler. A kill meant for node-B's pid 1 also killed node-A's pid 1, since each scheduler counts its own pids.
  • handle_migrate ingested every migrate-request, including the source's own request to another node. A migrated process therefore ran on the source as well as the target, and every node counted every ack.

Both handlers now return unless the message's path is their own node's (control.<self>, migrate.<self>). Migration to self is already refused (MigrateToSelfFails), so nothing relied on a source ingesting its own request.

Test. TwoCoordinatorTest.CB02_ControlAndMigrateReachOnlyTheirNode uses two coordinators on one bus, and comes first, in its own commit.

  • A kill node-A sends to node-B's pid leaves node-A's process with the same pid alone.
  • A migration from node-A to node-B gives node-B one copy and node-A none, and each node counts one completed migration.

Before the fix, the test failed on Windows (MSVC Release) with 2 completed migrations on each node instead of 1. With the fix, state_exec_coordinator_test passes 75 of 75, and CB02 passes 50 of 50.

Stage 0 found this bug. It was approved in Stage 1's plan (S1-Q10) and is CB-2 in Stage 2's plan (state-exec-perf/threaded-impl/S2.md, S2-Q14).

CB02_ControlAndMigrateReachOnlyTheirNode: a kill node-A sends to node-B
must leave node-A's process with the same pid alone, and a migration from
node-A to node-B must be ingested by node-B only. It fails before the next
commit's fix.
…rate messages

A coordinator subscribes to the whole __state_exec prefix, so on a bus that
several nodes share it saw every node's control.<node> and migrate.<node>
messages. handle_control posted each command to its own scheduler, so a kill
meant for node-B's pid 1 also killed node-A's pid 1. handle_migrate ingested
every migrate-request, the source's own request to another node included, so
a migrated process ran on the source as well as the target, and every node
counted every ack.

Both handlers now return unless the message's path is their own node's
(control.<self>, migrate.<self>). Migration to self is already refused, so
nothing relied on the source ingesting its own request. Stage 0 found the
bug (CB-2 in threaded-impl/S2.md, approved in S1-Q10 and S2-Q14).
@transfix
transfix merged commit 7d9650d into master Nov 13, 2026
33 checks passed
@transfix
transfix deleted the fix/coordinator-own-node branch November 13, 2026 22:58
transfix added a commit that referenced this pull request Nov 14, 2026
…#1177, #1167) into perf/threaded-s1b

The one conflict is the sanitizers' SAN_CXX_TESTS list in ci.yml: this branch added
stream_test, net_ws_client_test and ariadne_host_test, and #1167 added skeleton_test. The
list keeps all four.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant