Skip to content

fix(tracing): replace EnteredSpan-across-.await with .instrument() in zeph-context#4834

Merged
bug-ops merged 1 commit into
mainfrom
4828-entered-across-await-context
Jun 5, 2026
Merged

fix(tracing): replace EnteredSpan-across-.await with .instrument() in zeph-context#4834
bug-ops merged 1 commit into
mainfrom
4828-entered-across-await-context

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes three span.entered() guards held across .await points in fidelity.rs — an async correctness bug that silently prevents work-stealing on the tokio multi-thread scheduler
  • Adds #[tracing::instrument] to four previously uninstrumented pub async fn in zeph-context

Changes

crates/zeph-context/src/fidelity.rs

  • embed_query (line ~273): inline span replaced with .instrument(info_span!(...)).await
  • embed_prepass_dyn call (line ~304): inline span replaced with .instrument(info_span!(...)).await
  • apply_scores (line ~477): body-level .entered() replaced with #[tracing::instrument(name = "context.fidelity.apply", skip_all)] on the function
  • embed_prepass free fn + FidelityScorer::score_and_apply: added #[tracing::instrument]

crates/zeph-context/src/typed_page.rs

  • CompactionAuditSink::open + ::flush: added #[tracing::instrument]

Test plan

  • cargo check -p zeph-context — clean
  • cargo clippy -p zeph-context --all-targets -- -D warnings — clean
  • cargo nextest run -p zeph-context — 232/232 pass
  • cargo nextest run --workspace --lib --bins — 10496/10496 pass
  • cargo +nightly fmt --check — clean

Closes #4828
Closes #4829

@github-actions github-actions Bot added bug Something isn't working size/S Small PR (11-50 lines) documentation Improvements or additions to documentation rust Rust code changes and removed size/S Small PR (11-50 lines) labels Jun 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) June 5, 2026 14:56
… 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
@bug-ops bug-ops force-pushed the 4828-entered-across-await-context branch from f754005 to 8ed15ed Compare June 5, 2026 14:58
@github-actions github-actions Bot added the size/S Small PR (11-50 lines) label Jun 5, 2026
@bug-ops bug-ops merged commit 660ddc6 into main Jun 5, 2026
57 of 59 checks passed
@bug-ops bug-ops deleted the 4828-entered-across-await-context branch June 5, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant