[ABA-19] test(vortex-session): repro for with_handle mutating shared cloned state#11
Open
abnobdoss wants to merge 1 commit into
Open
[ABA-19] test(vortex-session): repro for with_handle mutating shared cloned state#11abnobdoss wants to merge 1 commit into
abnobdoss wants to merge 1 commit into
Conversation
…loned state Add an ignored regression test `issue_aba19_session_with_handle_does_not_mutate_clone` in `vortex-io/src/session.rs` that demonstrates the bug: `RuntimeSessionExt::with_handle` writes through the shared `Arc<SessionVars>` DashMap, so calling it on a clone silently mutates every other clone of the same session — including the original. The test is marked `#[ignore]` pending a decision on fix semantics (copy-on-write DashMap vs. fully independent clone). Run with `--ignored` to reproduce the failure. Signed-off-by: Abanoub Doss <abnobdoss@proton.me> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Abanoub Doss <abanoub.doss@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
issue_aba19_session_with_handle_does_not_mutate_cloneinvortex-io/src/session.rsthat demonstrates the concurrency bug described in ABA-19; no fix is included pending a session-clone semantics decision.VortexSession, clones it, callswith_handle(h)on the clone inside ablock_onscope, and then asserts the original session'sRuntimeSession.handleremainsNone— an assertion that fails today becausewith_handlewrites directly into the sharedArc<SessionVars>DashMap.cargo test -p vortex-io --lib -- --ignored issue_aba19_session_with_handle_does_not_mutate_cloneto reproduce the failure deterministically.Linear
ABA-19
Bug sites (develop / 0.72.0)
vortex-session/src/lib.rs:28—pub struct VortexSession(Arc<SessionVars>):Cloneis a bare Arc bump; every clone shares the same DashMap.vortex-io/src/session.rs:63-65—with_handlecallsself.get_mut::<RuntimeSession>().handle = Some(handle), which writes through the shared Arc into the common DashMap, mutating all clones.Open question
Should
with_handlebranch a copy-on-write session (deep-clone the DashMap before writing), or shouldVortexSession::cloneitself produce a fully independent state? The current "clone shares state" contract is silently load-bearing for callers that intentionally share extension registries across clones; changing clone semantics is a wider API break than forking insidewith_handle.Test plan
cargo test -p vortex-io --lib— all existing tests pass, new test is skipped (ignored).cargo test -p vortex-io --lib -- --ignored issue_aba19_session_with_handle_does_not_mutate_clone— test fails with the ABA-19 reproduction message.🤖 Generated with Claude Code