Add: verify remote startup failure cleanup - #1692
Conversation
📝 WalkthroughWalkthroughRemote L3 activation now adds contextual errors for session opening and endpoint attachment failures. Linux acceptance tests verify complete process, SHM, session, and worker cleanup after several failure paths and confirm later daemon reuse. ChangesRemote session rollback
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/ut/py/test_worker/test_remote_zero_residual.py`:
- Around line 212-214: Update the cleanup in the test’s finally block after
thread.join(timeout=1.0) to assert that the observer thread is no longer alive
before returning. Use the existing thread object and preserve the stop signal
and timed join order.
- Around line 228-230: Update the assertions before
observed.assert_reclaimed(worker) in the test to require observed.shm_names to
be non-empty, ensuring the failure path captured at least one SHM segment before
cleanup.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99b60ece-de26-40f2-8288-e0a5c1abbf48
📒 Files selected for processing (3)
python/simpler/worker.pytests/ut/py/test_worker/_remote_zero_residual_target.pytests/ut/py/test_worker/test_remote_zero_residual.py
- Exercise open timeout, later-remote failure, and endpoint attach failure against real L4/L3 process trees. - Assert exact PID, process-group, shared-memory, and session cleanup before reusing the daemon. - Preserve failed worker identity without flattening startup timeout classification.
6f032e1 to
7aad1e3
Compare
`simpler-remote-worker` rejects anything but `host_tcp` (hw-native-sys#1011), and hw-native-sys#1688 narrowed the unit tests it knew about onto that profile. The zero-residual acceptance tests landed from hw-native-sys#1692 in the same window still asked for `sim`, so the merge of two independently green PRs left every case in that file failing its own setup with `only host_tcp transport is accepted by simpler-remote-worker` — the rollback each one exists to observe never ran. Unrelated to the Buffer ABI; it rides here because it is one line and it is what keeps `ut` red on every PR that touches nothing near it.
Summary
TimeoutErrorclassification when the startup budget is exhausted.later-remote activation failure, and native endpoint-attach failure.
exact child PIDs, remote process groups, shared-memory names, sessions,
and native resources are reclaimed.
Testing
.venv/bin/python -m pytest -q tests/ut/py/test_worker/test_remote_zero_residual.py tests/ut/py/test_worker/test_remote_startup_budget.py tests/ut/py/test_remote_l3_lifecycle.py tests/ut/py/test_callable_identity.pyupstream/main.venv/bin/pre-commit run --files python/simpler/worker.py tests/ut/py/test_worker/test_remote_zero_residual.py tests/ut/py/test_worker/_remote_zero_residual_target.py