fix(tracing): replace EnteredSpan-across-.await with .instrument() in zeph-context#4834
Merged
Merged
Conversation
… zeph-context Three synchronous span guards in fidelity.rs were held across .await points, silently preventing work-stealing on the tokio multi-thread scheduler. Replaced with .instrument(span).await on inline futures and #[tracing::instrument] on the containing function where the entire async body needed coverage. Also adds #[tracing::instrument] to four previously uninstrumented pub async fns: embed_prepass and FidelityScorer::score_and_apply (fidelity.rs), and CompactionAuditSink::open / ::flush (typed_page.rs). Closes #4828 Closes #4829
f754005 to
8ed15ed
Compare
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
span.entered()guards held across.awaitpoints infidelity.rs— an async correctness bug that silently prevents work-stealing on the tokio multi-thread scheduler#[tracing::instrument]to four previously uninstrumentedpub async fninzeph-contextChanges
crates/zeph-context/src/fidelity.rsembed_query(line ~273): inline span replaced with.instrument(info_span!(...)).awaitembed_prepass_dyncall (line ~304): inline span replaced with.instrument(info_span!(...)).awaitapply_scores(line ~477): body-level.entered()replaced with#[tracing::instrument(name = "context.fidelity.apply", skip_all)]on the functionembed_prepassfree fn +FidelityScorer::score_and_apply: added#[tracing::instrument]crates/zeph-context/src/typed_page.rsCompactionAuditSink::open+::flush: added#[tracing::instrument]Test plan
cargo check -p zeph-context— cleancargo clippy -p zeph-context --all-targets -- -D warnings— cleancargo nextest run -p zeph-context— 232/232 passcargo nextest run --workspace --lib --bins— 10496/10496 passcargo +nightly fmt --check— cleanCloses #4828
Closes #4829