Repository navigation
state_transport_ipc: count a mutation after dispatching it (fixes ThreeEndpointFanOut flake) - #732
Merged
Merged
Conversation
StateTransportIpcTest.ThreeEndpointFanOut failed on CI (#720, recipe / ubuntu-latest / Debug): after wait_for_received(1) returned, node B's "fan" was still "". The IPC reader bumped _recv_mutations before dispatch_inbound() applied the mutation to the shards, so wait_for_received() could return while the value was still in flight. OOB messages had the same order. state_transport_grpc already counts after dispatching. Count after dispatch, so wait_for_received*() returning means the receiving shards have applied what it counted. The counters are diagnostics; nothing but the waits reads them. Reproduced on master: 16 concurrent copies x 300 repeats of the test failed 5 of 4800 times, every time with "". With the fix: 16 x 1000 passed 16000 of 16000, and the whole StateTransportIpcTest suite, 32 copies x 200 repeats, passed 115200 of 115200. The other suites that use the IPC transport pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the flaky
StateTransportIpcTest.ThreeEndpointFanOut. It failed on #720'srecipe / ubuntu-latest / Debuglane (job 118253162021): line 477 read""for node B'sfaninstead of"hello".Cause. The IPC transport's reader bumped
_recv_mutationsbeforedispatch_inbound()applied the mutation to the receiving shards.wait_for_received()polls that counter, so it could return while the value was still in flight, and the test then read the state too early. OOB messages had the same order (_recv_messagesbeforedispatch_inbound_message()).state_transport_grpcalready counts after dispatching.Fix. Count after dispatch in the IPC transport, for both, and say so in the header. Once
wait_for_received*()returns, the receiving shards have applied what it counted. That is what all 25 test call sites already assume. The counters are diagnostics: nothing but the waits and thetotal_received_*()accessors reads them. The test itself is unchanged. A probe showed each node receives exactly one mutation here (the two writes coalesce), so waiting for one is the right count.Verified (Linux, Release, shared):
""StateTransportIpcTest.*suite, 32 copies × 200The other suites that use the IPC transport (
state_multiprocess_ipc_test,state_reconnect_resilience_test,state_exec_multiprocess_test,state_snapshot_protocol_test) pass: 32/32 in ctest, with the two opt-in stress/perf tests skipped as usual. clang-format 18.1.8 is clean on the changed lines.