Skip to content

[ABA-19] test(vortex-session): repro for with_handle mutating shared cloned state#11

Open
abnobdoss wants to merge 1 commit into
developfrom
fix/aba-19-session-with-handle-shared-state
Open

[ABA-19] test(vortex-session): repro for with_handle mutating shared cloned state#11
abnobdoss wants to merge 1 commit into
developfrom
fix/aba-19-session-with-handle-shared-state

Conversation

@abnobdoss
Copy link
Copy Markdown
Owner

Summary

  • Adds an ignored regression test issue_aba19_session_with_handle_does_not_mutate_clone in vortex-io/src/session.rs that demonstrates the concurrency bug described in ABA-19; no fix is included pending a session-clone semantics decision.
  • The test creates a VortexSession, clones it, calls with_handle(h) on the clone inside a block_on scope, and then asserts the original session's RuntimeSession.handle remains None — an assertion that fails today because with_handle writes directly into the shared Arc<SessionVars> DashMap.
  • Run with cargo test -p vortex-io --lib -- --ignored issue_aba19_session_with_handle_does_not_mutate_clone to reproduce the failure deterministically.

Linear

ABA-19

Bug sites (develop / 0.72.0)

  • vortex-session/src/lib.rs:28pub struct VortexSession(Arc<SessionVars>): Clone is a bare Arc bump; every clone shares the same DashMap.
  • vortex-io/src/session.rs:63-65with_handle calls self.get_mut::<RuntimeSession>().handle = Some(handle), which writes through the shared Arc into the common DashMap, mutating all clones.

Open question

Should with_handle branch a copy-on-write session (deep-clone the DashMap before writing), or should VortexSession::clone itself 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 inside with_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

…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>
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