Skip to content

fix: avoid deadlock in commit_artifacts and stabilize golden_execute test#296

Merged
jverdicc merged 1 commit intomainfrom
codex/fix-deadlock-in-golden_execute_claim_capsule_hash
Mar 2, 2026
Merged

fix: avoid deadlock in commit_artifacts and stabilize golden_execute test#296
jverdicc merged 1 commit intomainfrom
codex/fix-deadlock-in-golden_execute_claim_capsule_hash

Conversation

@jverdicc
Copy link
Owner

@jverdicc jverdicc commented Mar 2, 2026

Motivation

  • Fix a deadlock observed in commit_artifacts when ASPEC rejects a wasm module while the state.claims lock is still held, which caused golden_execute_claim_capsule_hash_and_etl_index_stable to hang indefinitely.
  • Ensure the test fails fast and gives a clear diagnostic if a future deadlock or infinite await occurs.

Description

  • Change commit_artifacts (crates/evidenceos-daemon/src/server/handlers_v2.rs) to record ASPEC rejection under the claims lock, set a local aspec_rejected flag, drop the lock, call persist_all_with_trial_router, and only then return the FailedPrecondition error if the module was rejected (avoids persisting while holding claims).
  • Update the golden test (crates/evidenceos-daemon/src/server/core.rs) to assert the deterministic ASPEC rejection behavior for the burn wasm module and wrap the test body in tokio::time::timeout(Duration::from_secs(10), ...) so hangs fail fast with a clear message.
  • Small formatting / bookkeeping adjustments to keep the modified flow clear and maintain state persistence semantics.

Testing

  • Ran cargo fmt --check, which succeeded.
  • Ran the targeted test cargo test -p evidenceos-daemon --lib server::tests::golden_execute_claim_capsule_hash_and_etl_index_stable -- --nocapture, which passed after the fix.
  • Attempted a full workspace test run (cargo test --workspace), but the full workspace run was not completed here due to long compile/test runtime in this environment.

Codex Task

@jverdicc jverdicc merged commit 3a61506 into main Mar 2, 2026
6 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant