Skip to content

fix: align async read disposal with synchronous reads - #115

Merged
AGiorgetti merged 1 commit into
developfrom
fix/109-async-disposal
Nov 17, 2026
Merged

AGiorgetti merged 1 commit into
developfrom
fix/109-async-disposal

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #109.

Rebased onto develop after #116. #116 already enforces per-batch disposal checks in default mode, but the legacy whole-read translation path bypasses those guards. This change is still needed to close that gap.

  • Check disposal before each cursor advance in the shared traversal, covering all seven routes and both WrapAsyncApplicationExceptions settings.
  • Preserve in-flight acquisition/advancement, delivery within an acquired batch, early-stop completion, unconditional cursor cleanup, and terminal notification behavior.
  • Expand deterministic gated regression coverage to both modes (196 assertions).

Breaking change

An active legacy-mode async read now reports ObjectDisposedException through its existing error path at the next cursor advance after disposal. The wrapping opt-out does not disable lifetime checks. Default mode retains #116 behavior. Callers needing prompt interruption should cancel and await active reads before disposing.

Verification

Current rebased head: 3f69d30fe8bf51870d3ced29952d175bd3e20b8e.

  • Independent source review and CRLF-aware whitespace check passed.
  • GitHub CI completed successfully for this exact head: https://github.com/NEventStore/NEventStore.Persistence.MongoDB/actions/runs/44111893295
  • Ubuntu and Windows build jobs passed.
  • All seven full-suite Linux test jobs passed 2,078 tests each, zero failures and zero skips: net8.0/net9.0/net10.0 with Driver 3.0.0 and 3.13.0 on MongoDB 7.0.45, plus net10.0/Driver 3.13.0 on MongoDB 9.0.4.
  • Local test execution had been blocked by an environment safety check involving an unexpected cloud-instance metadata request. That request was not bypassed. The results above are verified CI executions, not local results. No current-head net472 execution is claimed.
  • Historical pre-rebase evidence only: 98 focused tests passed on net472/net8/net9/net10 with Driver 3.0/3.13; full net10/Driver 3.13 suite 1,236 passed, zero skipped. Those older results are not verification of this rebased revision.

Co-authored-by: Alessandro Giorgetti alessandro.giorgetti@live.com
Co-authored-by: Codex (OpenAI) codex@openai.com

@AGiorgetti
AGiorgetti marked this pull request as ready for review November 12, 2026 15:34
Co-authored-by: Alessandro Giorgetti <alessandro.giorgetti@live.com>
Co-authored-by: Codex (OpenAI) <codex@openai.com>
@AGiorgetti
AGiorgetti force-pushed the fix/109-async-disposal branch from 5959536 to 3f69d30 Compare November 17, 2026 15:13
@AGiorgetti
AGiorgetti merged commit 936402e into develop Nov 17, 2026
9 checks passed
@AGiorgetti
AGiorgetti deleted the fix/109-async-disposal branch November 18, 2026 10:27
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.

[P3] Define disposal behavior during active asynchronous reads

1 participant