Skip to content

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

Open
AGiorgetti wants to merge 1 commit into
developfrom
fix/109-async-disposal
Open

AGiorgetti wants to merge 1 commit into
developfrom
fix/109-async-disposal

Conversation

@AGiorgetti

Copy link
Copy Markdown
Member

Summary

Closes #109.

  • Align asynchronous observer reads with synchronous enumeration: check disposal before each cursor advance across all seven read routes.
  • Keep callbacks and batches already in flight uninterrupted; disposal does not itself cancel a driver operation.
  • Add deterministic gated tests and a Breaking Changes / migration note.

Breaking change

An active async read now reports ObjectDisposedException through its existing error path when it next attempts to advance its cursor after engine disposal. Callers needing prompt interruption should cancel and await active reads before disposing the engine.

Verification

  • Test-first: 42 failing cases before the fix; focused suite expanded to 98 passing cases.
  • All 98 focused tests passed on net472, net8.0, net9.0 and net10.0 with MongoDB Driver 3.0.0 and 3.13.0 (eight lanes).
  • Full net10.0 / Driver 3.13.0 suite: 1,236 passed, zero skipped.
  • Independent review completed; CRLF-aware whitespace check passed.

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

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