Skip to content

fix(common): keep executor alive while contexts exist - #2

Open
Wondertan wants to merge 1 commit into
libid/kos-domain-separation-alpha6from
fix/executor-context-lifetime-alpha6
Open

fix(common): keep executor alive while contexts exist#2
Wondertan wants to merge 1 commit into
libid/kos-domain-separation-alpha6from
fix/executor-context-lifetime-alpha6

Conversation

@Wondertan

@Wondertan Wondertan commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

  • retain the executor shutdown guard in every context created from it
  • shut the worker pool down only after the final executor/context owner drops
  • cover the reported lifetime with a focused regression test

Root cause

A TLSN SessionHandle owns MPZ's Executor, while a spawned prover owns only a Context. Dropping the handle dropped the executor, which cancelled queued tasks still awaited by that context. async-task::Task then panicked with Task 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 passed
  • cargo clippy -p mpz-common --all-targets --all-features -- -D warnings
  • regression: a context can still run join after its creating Executor is dropped

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant