Repository navigation
Conversation
This is fixing a bug where o2-sim hangs when the hit merger starts after the sim workers have finished. A worker called _exit with hits still queued in its simdata socket, so they were lost. The data channel now has an infinite linger and the worker closes it before exiting, which blocks until the merger has taken the hits. A parent-death signal makes sure a blocked worker does not outlive the o2-sim process tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merger is now listening when the workers send their first hits, so fast workers (e.g. with --noGeant) no longer wait for it at exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sawenzel
force-pushed
the
o2sim-worker-wait-for-driver
branch
from
November 5, 2026 19:49
9515f48 to
033437c
Compare
This branch has not been deployed
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.
This is fixing a bug where o2-sim hangs when the hit merger starts after the sim workers have finished. This was seen with
--noGeantevent generation in anchored MC, where a worker finishes within seconds. The worker exited 10 s after its last chunk with hits still queued in its ZMQ socket, so they were lost and the merger waited forever.Workers now close their data channel with an infinite linger before exiting, which blocks until the merger has taken the hits. In addition, the merger is now spawned before the workers.
I tested this with the merger held back for 60 s before binding (20 events, 4 workers).
devhangs with 3 of 20 events written, and this PR finishes with all 20. Without the delay, runtime and kinematics are unchanged.Assisted by Claude Code.