fix(zenoh): reopen pooled sessions after fork - #3457
Open
jiajiayao wants to merge 4 commits into
Open
Conversation
jiajiayao
marked this pull request as ready for review
August 13, 2026 12:09
jiajiayao
requested review from
Dreamsorcerer,
leshy,
mustafab0,
paul-nechifor and
spomichter
as code owners
August 13, 2026 12:09
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3457 +/- ##
==========================================
+ Coverage 74.05% 74.06% +0.01%
==========================================
Files 1283 1283
Lines 124704 124729 +25
Branches 11141 11142 +1
==========================================
+ Hits 92349 92383 +34
+ Misses 29493 29487 -6
+ Partials 2862 2859 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Contribution path
Problem
With the Zenoh transport,
dimos run ... --daemonbuilds the coordinator before double-forking. That can populate the process-default Zenoh session pool in the parent. The daemon grandchild inherits the Python session objects, but not Zenoh's runtime threads, soCoordinatorRPC.serve()reuses a dead session and out-of-process clients cannot reachCoordinator/ping.The inherited pool lock is also unsafe to reuse if another parent thread held it when the process forked.
Solution
Make
ZenohSessionPoolprocess-aware:os.getpid()changesclose_all()behaviorA regression test simulates the PID transition and verifies that the child opens a second session while leaving the inherited parent handle untouched.
How to Test
Local result on macOS: 78 passed, 9 skipped. The skipped cases are existing macOS-specific RPC skips.
Also run:
All passed.
The repository-wide parallel fast suite was attempted locally but was not a clean signal on macOS: unrelated worker/relay/control E2E tests stalled or failed under the 16-worker run, and a serial
test_e2e_daemon.pyrun stalled during worker bootstrap before executing a test. The focused Zenoh/RPC/daemon tests above were rerun after that attempt and remained green. A Linux reproduction of the actual--daemoncommand remains appropriate in CI or maintainer validation.AI assistance
OpenAI Codex with GPT-5 assisted with issue analysis, implementation, tests, and PR preparation. The process-lifecycle behavior, two-file diff, and reported validation results were reviewed before submission.
Checklist