tractor/ai/prompt-io/opencode/20260828T045119Z_fb6d81d3_p...

1.2 KiB
Raw Blame History

Raw output - detect child death before parent handshake

The human asked to continue WireGuard Layer C after child entrypoints learned to consume inherited network namespace capabilities.

Generated code

git diff HEAD~1..HEAD -- tractor/spawn/_spawn.py tractor/spawn/_trio.py tests/test_spawning.py

Race a spawned childs initial parent handshake against its process wait operation. Return the established channel when the handshake wins; raise ActorFailure with the exit status when the process dies first. Use the race in the Trio exec backend instead of waiting indefinitely on IPCServer.wait_for_peer().

Add deterministic Trio tests for handshake-first, death-first, simultaneous, and waiter-error schedules, controlling readiness with events rather than sleeps. Exercise the full Trio backend with a fake dead process to prove pre-publication event registration and exact failed-startup cleanup.

Scope boundary

This prerequisite prevents pre-connection namespace-entry failures from hanging their parent. Namespace FD transfer itself remains the next commit.