fix(common): keep executor alive while contexts exist - #2
Open
Wondertan wants to merge 1 commit into
Open
Conversation
Contexts can outlive the Executor which created them. Retain a shared shutdown guard so dropping an owner does not cancel active context tasks. Assisted-by: GPT-5 Signed-off-by: Wondertan <hlibwondertan@gmail.com>
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
Root cause
A TLSN
SessionHandleowns MPZ'sExecutor, while a spawned prover owns only aContext. Dropping the handle dropped the executor, which cancelled queued tasks still awaited by that context.async-task::Taskthen panicked withTask polled after completion.This is the alpha.6-compatible lifetime fix from upstream MPZ #403, without its unrelated global-pool, concurrency-limit, dependency, or API refactors.
This is orthogonal to #1; it targets #1's base branch and does not alter KOS.
Verification
cargo test -p mpz-common— 20 passedcargo clippy -p mpz-common --all-targets --all-features -- -D warningsjoinafter its creatingExecutoris dropped