Neil
bba32bd00c
fix(daemon): let the publisher replace a dead endpoint, not a third party ( #12882 )
...
Terminals froze app-wide several times daily, needing a manual pkill. libuv
unlinks the pathname a server bound to when it closes, with no ownership check,
so a departing daemon deleted whichever socket then sat at the canonical path —
including a live replacement's. The replacement kept hosting PTYs no client
could reach.
#12709 fixed that mechanism; this replaces the shape around it. Two invariants:
only a daemon publishing itself onto the canonical endpoint may mutate that
entry, and only by replacing one it has itself just proven dead; and no actor
removes a name it did not create.
Publish binds a private name, takes the canonical one with an exclusive link,
and on EEXIST proves the incumbent dead by connecting before replacing it in a
single rename. Only 'connected' means occupied and only refused/missing prove
death — a timeout proves nothing and declines. Deletes the claim sweeper, the
reclaim tail of killStaleDaemon, and three unfenced unlinkSync(socketPath)
calls in the launcher.
Measured: rename exposed no gap across 6,525 darwin / 8,004 linux probes of a
live handover, where unlink-then-link gapped on 200 of 200.
Verified on all three platforms: full suite on macOS and Linux, and daemon
restart e2e on a real windows-2022 host. Contract in src/main/daemon/AGENTS.md.
2026-08-07 22:33:50 -07:00
..
2026-04-17 01:42:41 -04:00
2026-08-07 22:33:50 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-05 23:54:30 -07:00
2026-08-05 23:54:30 -07:00
2026-07-23 16:56:01 -07:00
2026-08-04 17:23:01 -07:00
2026-07-23 16:56:01 -07:00
2026-07-26 15:05:39 -07:00
2026-07-30 17:07:40 -07:00
2026-08-03 16:28:49 -07:00
2026-08-03 16:28:49 -07:00
2026-07-22 14:45:03 -07:00
2026-07-27 17:17:47 -07:00
2026-07-27 17:17:47 -07:00
2026-06-29 22:38:29 -07:00
2026-07-28 15:12:44 -07:00
2026-07-21 20:51:28 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-05 23:54:30 -07:00
2026-08-07 22:33:50 -07:00
2026-08-05 20:52:22 -07:00
2026-08-05 20:52:22 -07:00
2026-07-07 19:21:07 -04:00
2026-07-07 19:21:07 -04:00
2026-08-03 20:00:28 -07:00
2026-07-23 01:45:24 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-05 23:54:30 -07:00
2026-07-29 20:20:11 -07:00
2026-07-07 19:21:07 -04:00
2026-07-23 18:35:31 -07:00
2026-08-07 22:33:50 -07:00
2026-07-31 04:56:14 -07:00
2026-07-31 04:56:14 -07:00
2026-07-31 04:56:14 -07:00
2026-07-31 04:56:14 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-07-26 14:51:21 -07:00
2026-07-26 14:51:21 -07:00
2026-07-15 15:23:35 -07:00
2026-08-05 23:54:30 -07:00
2026-07-20 14:43:42 -07:00
2026-07-31 04:56:14 -07:00
2026-07-31 04:56:14 -07:00
2026-08-03 20:00:28 -07:00
2026-08-03 23:48:18 -07:00
2026-07-28 15:12:44 -07:00
2026-08-05 20:52:22 -07:00
2026-08-04 17:25:20 -07:00
2026-08-07 22:33:50 -07:00
2026-07-21 20:51:28 -07:00
2026-07-21 20:51:28 -07:00
2026-07-30 00:31:34 -07:00
2026-08-03 20:00:28 -07:00
2026-08-06 21:18:41 -07:00
2026-08-05 20:52:22 -07:00
2026-07-23 18:35:31 -07:00
2026-08-03 15:03:37 -07:00
2026-07-30 16:02:08 -07:00
2026-08-05 21:12:32 -07:00
2026-07-26 14:51:21 -07:00
2026-08-03 15:03:37 -07:00
2026-08-07 22:33:50 -07:00
2026-08-03 20:35:40 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-08-06 21:18:41 -07:00
2026-08-06 21:18:41 -07:00
2026-08-07 22:33:50 -07:00
2026-08-07 22:33:50 -07:00
2026-07-10 17:27:47 -07:00
2026-07-19 20:25:52 -07:00
2026-07-23 19:00:43 -07:00
2026-07-23 19:00:43 -07:00
2026-07-19 20:25:52 -07:00
2026-07-27 17:17:47 -07:00
2026-07-23 19:00:43 -07:00
2026-07-23 19:00:43 -07:00
2026-07-27 17:17:47 -07:00
2026-07-23 19:00:43 -07:00
2026-08-05 23:54:30 -07:00
2026-07-10 17:27:47 -07:00
2026-08-03 12:47:41 -07:00
2026-08-05 20:52:22 -07:00
2026-08-06 21:18:41 -07:00
2026-08-06 21:18:41 -07:00
2026-08-05 20:52:22 -07:00
2026-08-03 20:00:28 -07:00
2026-06-12 16:31:24 -07:00
2026-07-02 14:50:15 -07:00
2026-07-19 16:04:05 -07:00
2026-07-29 11:31:35 -07:00
2026-06-18 16:48:43 -07:00
2026-08-03 21:00:57 -07:00
2026-06-29 22:38:29 -07:00
2026-07-29 18:21:26 -07:00
2026-07-29 18:21:26 -07:00
2026-04-17 01:42:41 -04:00
2026-07-26 01:13:00 -07:00
2026-07-26 01:13:00 -07:00
2026-07-29 18:21:26 -07:00
2026-07-14 01:50:56 -07:00
2026-08-01 03:35:34 -07:00
2026-08-01 03:35:34 -07:00
2026-08-01 03:35:34 -07:00
2026-08-01 03:35:34 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-06-08 16:36:04 -07:00
2026-06-08 16:36:04 -07:00
2026-06-29 22:38:29 -07:00
2026-07-19 16:04:05 -07:00
2026-07-19 16:04:05 -07:00
2026-06-19 17:14:55 -07:00
2026-06-19 17:14:55 -07:00
2026-06-21 18:51:44 -07:00
2026-06-21 18:51:44 -07:00
2026-04-17 01:42:41 -04:00
2026-04-17 01:42:41 -04:00
2026-08-05 21:12:32 -07:00
2026-08-05 21:12:32 -07:00
2026-07-21 20:51:28 -07:00
2026-07-21 20:51:28 -07:00
2026-07-19 15:20:54 -07:00
2026-07-20 16:16:34 -07:00
2026-08-05 00:36:22 -07:00
2026-08-05 00:36:22 -07:00
2026-07-10 17:27:47 -07:00
2026-08-03 21:00:57 -07:00
2026-08-03 21:00:57 -07:00
2026-08-01 00:25:35 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-03 21:00:57 -07:00
2026-07-20 03:18:24 -07:00
2026-07-11 10:45:55 -07:00
2026-07-15 15:23:35 -07:00
2026-07-30 01:14:12 -07:00
2026-07-30 01:14:12 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-07-26 01:13:00 -07:00
2026-07-28 15:12:44 -07:00
2026-07-25 00:41:18 -07:00
2026-07-27 17:40:46 -07:00
2026-07-25 00:04:34 -07:00
2026-07-23 16:56:01 -07:00
2026-07-26 01:13:00 -07:00
2026-07-26 01:13:00 -07:00
2026-07-28 15:12:44 -07:00
2026-07-26 01:13:00 -07:00
2026-07-28 15:12:44 -07:00
2026-07-29 18:21:26 -07:00
2026-07-23 06:22:56 -07:00
2026-07-23 06:22:56 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-08-03 21:00:57 -07:00
2026-08-03 21:00:57 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-07-28 15:12:44 -07:00
2026-07-29 18:21:26 -07:00
2026-07-29 18:21:26 -07:00
2026-07-28 15:12:44 -07:00
2026-08-03 11:11:14 -07:00
2026-07-21 20:51:28 -07:00
2026-07-21 20:51:28 -07:00
2026-08-03 11:11:14 -07:00
2026-08-03 11:11:14 -07:00
2026-07-22 14:45:03 -07:00
2026-07-20 20:50:25 -07:00
2026-07-28 15:12:44 -07:00
2026-07-21 20:51:28 -07:00
2026-07-22 22:58:09 -07:00
2026-07-24 14:12:51 -07:00
2026-07-15 15:23:35 -07:00
2026-05-30 02:14:22 -04:00
2026-07-21 20:51:28 -07:00
2026-07-29 11:31:35 -07:00
2026-07-24 14:12:51 -07:00
2026-07-23 01:45:24 -07:00
2026-07-10 17:27:47 -07:00
2026-07-19 20:25:52 -07:00
2026-07-10 17:27:47 -07:00
2026-07-19 16:04:05 -07:00
2026-07-24 14:12:51 -07:00
2026-07-25 22:28:07 -07:00
2026-07-10 17:27:47 -07:00
2026-08-03 20:00:28 -07:00
2026-07-10 17:27:47 -07:00
2026-07-19 20:25:52 -07:00
2026-07-19 17:31:34 -07:00
2026-08-03 11:11:14 -07:00
2026-07-02 18:41:23 -04:00
2026-07-02 18:41:23 -04:00
2026-07-19 16:04:05 -07:00
2026-07-19 16:04:05 -07:00
2026-07-29 11:31:35 -07:00
2026-04-17 01:42:41 -04:00