Repository navigation
Conversation
…kers Keep global tracer lifecycle instrumentation separate from the independently mergeable Windows enablement and startup breadcrumb fix in PR26763. Preserve the original operation implementation and add trace-equivalence and sustained slot-reuse coverage.
9 tasks done
…watchdog-active-operations-1008
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca freezes, a hang note can name operations that were still running. This draft adds that optional detail after the independent Windows watchdog and restart fix in #26763.
What Changed
Observe existing tracer span starts and ends and store up to 64 fixed operation names and start times in a 520-byte atomic buffer. The worker reads that buffer while the main thread is blocked; recovery retains the original detection-time snapshot. Marker parsing accepts only known names and bounded elapsed values, and restart writes the sanitized snapshot to the local trace.
The displayed diff is only operation capture, its CLI typecheck registration, and tests. Its base is the final core branch from #26763, not a prerequisite of that core PR. Rebase/retarget after core merges.
Why
#26719 asks for in-flight operations as well as Windows detection. Separating this feature lets reviewers assess the global tracer start/end hooks without delaying the Windows gate and lost-breadcrumb fixes. Reuse existing spans rather than introduce a second command observer or an unbounded worker-message queue.
Linked Issue
Refs #26719; the Windows/restart portion is #26763. This is limited to existing allowlisted spans, including git and Windows ACL work; it does not provide universal gh/WSL/file-write coverage or stack samples and is not a complete causal diagnosis.
Visual Proof
N/A — no UI changes. The original full implementation at
1b15061cea6e3c116c326cc0649215879f30d4f9was exercised through hidden Windows Electron CDP: a 10-second main-thread stall produced a note and recovery, then restart persisted the breadcrumb. Original operation probe recordedgit.exec:5606ms; an app.asar fixture recordedgit.exec:5694ms. These are prior full-feature receipts, not fresh app runs of this split draft or signed-release validation. A named-object comparison proves all production source at this draft head is byte-identical to preservedc1c68b96; only the new equivalence/burst test differs.Testing
At prior draft
400096feb86964d16e725392120e3d6a0c4156e6, fullORCA_BACKGROUND_LAUNCH=1 pnpm tcpasses node/CLI/web, the changed-code quality gate passes, and 84 focused tests across 13 files pass. Tests cover atomic slot reuse, overflow bounds, privacy, detection/recovery snapshot equality, startup sink ordering, consent, and stop/error/exit cleanup. New tests compare trace records with tracking enabled/disabled and exercise 20 full-capacity bursts through the production tracer.Fresh seven-trial macOS no-op-sink benchmark compares exact core tracer with this draft's tracer, both without and with an observer, at 40,000 spans/trial. Raw samples and exact source attribution are preserved in the split report; this is a noisy microbenchmark, not an end-to-end UI performance claim. Fresh Windows tests also pass all 84 tests/13 files. A Windows comparison of the exact core and draft tracer bundles produces equal trace records; seven 40,000-span trials measured median added overhead about 0.611µs/span (macOS: 0.204µs/span), with 520-byte buffers and zero occupied slots after every trial. Normal CI remains pending in the recorded snapshot; draft status skips some platform jobs.
Final head:
ac0019a3ed6e87e1686f87767a9b4f32a9bfccd3, based on coreed4fa03decf3af5e637a862058eccf76ca8bc556. A non-force merge brings in only the two CI consent fixture corrections from core; the displayed diff remains the optional operation feature. At this final head, 116 tests pass under inherited CI indicators (84 feature/core tests plus 32 consent/orcad tests), full node/CLI/web typecheck passes, and original-base quality reports zero findings. The equivalence/burst suite remains green. Production source is unchanged from the prior draft; Windows execution and benchmark receipts above remain attributed to that prior head. Final-head CI is pending.Review
DRAFT: adds synchronous callbacks to the global tracer on all platforms; the enabled watchdog subscribes only on macOS/Windows when local consent and development/packaging gates allow it. Review this broader performance/lifecycle risk separately from #26763. Observer errors cannot alter operation behavior, and unsubscribe/clear run at every worker shutdown boundary.
Agent skill upstream boundary
Notes
Only fixed names and elapsed times cross the worker boundary; no dynamic operation names, commands, attributes, or paths. The original feature source at
c1c68b96b1f0ce45ac754742efa32cae4bc14646is preserved in ancestry and local branchnwparker/watchdog-operations-preserved-1008; this split does not discard it. The base's startup-order approach and regression test were adapted from @Fanzzzd's #26468 (3cee2eadc423bee88e5e7bc83e56aef238b031f0,eb026bae9c7481e42cd50e993372ee2aab821c55); its originalCo-authored-by: fanzzzd <[email protected]>trailer remains in ancestry. That attribution belongs to the core startup fix, not authorship of this operation tracker.No remote protocol, SSH execution authority, folder workspace assumption, renderer UI, or platform command behavior changes. Full signed-release, Linux and SSH manual checks remain unperformed.
Checklist