Repository navigation
fix: harden dashboard shutdown and response-handle evidence - #4989
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
ScriptedAlchemy
marked this pull request as draft
November 27, 2026 04:17
Capture the task authority before waiting so a concurrent start cannot redirect an old stop to its replacement. Keep HTTP fixture cleanup explicit and share the manager test lock.
ScriptedAlchemy
marked this pull request as ready for review
November 27, 2026 04:33
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.
Why
Audit follow-up to #4979, which merged while this review was in progress.
The inventory test used a single timing sample as an acceptance gate, so scheduler delays could fail it without a payload-reading regression. Its Unicode fixture also divided repetitions by seven although
é🦀occupies six UTF-8 bytes: the reported 8 MiB inventory/publish/replay fixture was approximately 6.86 MiB.Changes
Production response-handle behavior is unchanged. The commit-gate rollback and zero-row replay checks remain in place. The earlier expiry/lookup experiments used actual 8 MiB ASCII payloads; the Unicode size correction applies to inventory, fresh publication, and replay.
Dashboard shutdown and fixture isolation
CI exposed a settings PATCH timeout followed by two dashboard shutdown tests finding unexpected global state. The HTTP journey reported its assertion-worker panic before stopping its dashboard, and the two test groups used separate locks for the same manager.
Review also found an independent production race: an old stop operation could re-read the manager after suspension, follow a newly started dashboard at the same root, and abort or join that replacement. Shutdown now captures the original task authority, completion signal, and address under the initial lock. It waits for, aborts, and joins that task only, and removes the manager entry only if it still names the captured task.
A deterministic regression suspends stop A, completes and reaps A, installs live replacement B, then proves the old stop completes without following or stopping B. It uses task identity and explicit polling, with no sleeps or widened deadlines. Already-signalled completion still takes priority over an expired deadline.
The original PATCH timeout's wait boundary was not captured, so its latency cause is unproven. The same HTTP journey and the two shutdown tests passed on the later #4984 CI head without these dashboard changes; that does not establish that the timeout cannot recur. The cleanup and task-ownership fixes address independently demonstrated defects.
Validation
Independent source review covered response-handle SQL/value conversion and transaction semantics, dashboard task identity, concurrent Start/Stop joins, and the replacement regression.
Pinned Rust 1.100.0 formatting and
git diff --checkpass.Local
bazel test //crates/tracedecay-global-db:unit_test --test_arg=response_handle --test_output=allpassed: 18 tests, 0 failures, including all four store-cost tests. That response-handle source is byte-identical to this PR.The first hosted run passed the full global-db target and 180 of 181 Linux targets; its main daemon failures motivated the fixture investigation above.
The final dashboard correction could not execute locally because linking the full daemon test binary exceeded this host's memory; no local dashboard-test pass is claimed.
Hosted Linux CI on
3b89e4fc264a8601dd8339e51f7d9cd9d5567b5apassed all 181 Bazel test targets (70 executed, 111 cached), and Clippy passed. The main daemon unit target, daemon suite, CLI core suite, dashboard API suite and runtime acceptance suite executed successfully. The retained runtime acceptance log reports 142 passed, 0 failed.CI retains the successful main-unit target result, rather than individual successful case logs, so the replacement-task regression and HTTP fixture have full-suite evidence. The original four-second PATCH deadline is unchanged, and this pass does not establish the cause of the earlier timeout.
Windows CI on the same head passed the full workspace build/type-check and the focused addon-lock upgrade-refusal test. The workflow used
native=none, so its broader Windows native-test step was skipped.