[Bug] prime-agent status kills active IPython forkservers #1695
Replies: 4 comments 1 reply
|
macOS is fixed on the same branch: Validation on macOS 27 arm64 and Debian 12 aarch64: I checked this against the recovery half rather than duplicating it. #1693 by @coleleavitt cherry-picks onto current One gap worth naming: the current tests parse fixture strings, so nothing exercises the real discovery path. Driving a live forkserver socket through the actual |
|
@sirouk I independently reproduced this and I agree with your diagnosis — it's correct end to end. I traced the whole chain through prime-agent, Node core, libuv, and the kernel AF_UNIX layer, then confirmed it with a live socket repro. Sharing the codepath plus two gaps I think are worth closing. Confirmed codepathDiscovery has no forkserver exclusion. The forkserver kills itself on the probe ( server.on("connection", (socket) => {
this.conn = socket; // overwrites the live Python control channel
socket.on("close", () => this.markDead()); // probe disconnect -> markDead()
});
Why the second connection is even delivered, layer by layer:
Live repro (faithful replica of the handler): a probe connect->close gives Two gaps I'd suggest closing
Neither is covered by the current string-parsing tests — which lines up with the real- For what it's worth on the recovery side: I hit the permanent- |
|
main...coleleavitt:prime-agent:fix/forkserver-probe-hardening |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Linux v0.8.0,
prime-agent status --jsoncan terminate active IPython forkservers.Daemon discovery treats every Unix listener owned by a
prime-agentprocess as a public daemon. That includes/tmp/prime-agent-forkserver-*/control.sock. The status probe connects and disconnects;ForkServerreplaces its established control connection with the probe, then interprets the probe closing as forkserver death and terminates the forkserver. Every IPython kernel forked from it exits.Reproduction
prime-agent status --json.The next cell returns
Kernel has been shut down. In the observed incident, two independent worker forkservers were marked inactive at the same millisecond after one status scan.Proposed fix
ssandlsofdaemon discovery.This prevents the kernel death itself. Discussion #1659 and closed PR #1693 address the separate recovery problem after an unexpected death.
All reactions