fix(cli): flush tracing guards on all remaining application-level exit sites - #6714
Merged
Conversation
…t sites std::process::exit skipped TracingGuards::drop's flush-on-drop logic at every std::process::exit call site reachable from run() after init_tracing, the same bug class as #6696/#6697/#6698/#6708. Rather than threading exit-signal types through each site, unify on plain anyhow Result propagation: load_config_or_default now returns Result<Config, ConfigLoadError> instead of exiting internally, and every caller (18 total, including the 7 exit sites in commands/bench.rs) uses plain ? so an ordinary Err return unwinds and flushes tracing_guards via normal drop. Closes #6709
bug-ops
force-pushed
the
fix/6709-guard-flush-bypass-sites
branch
from
July 28, 2026 20:44
f968eb3 to
04d716d
Compare
bug-ops
enabled auto-merge (squash)
July 28, 2026 20:44
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.
Summary
Follow-up to #6698/#6708 — closes the last application-level
std::process::exitsites that bypassedTracingGuards::drop's flush-on-drop logic. The issue named two sites (src/bootstrap/config.rs:27, seven insrc/commands/bench.rs), but review turned up 16 more instances of the same pattern reachable fromrun()afterinit_tracing.Rather than threading a bespoke exit-signal type through each site, this unifies on plain
anyhow::Result+?propagation everywhere:load_config_or_defaultnow returnsResult<Config, ConfigLoadError>instead of exiting internally, and all 18 callers (including bench.rs's 7 sites) use?/anyhow::bail!so an ordinaryErrreturn unwinds and flushestracing_guardsvia normaldrop. No new machinery, less code than the original approach.Verified: zero application-level
std::process::exitcalls remain insrc/outsidetracing_init.rs's own sanctioned flush primitives.Closes #6709
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo clippy --profile ci --workspace --all-targets --features bench -- -D warnings(separate bench matrix entry)cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 15312/15312 passedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --staged --no-banner --redact