Skip to content

Second ExecuteAsync call on a single-use streaming processor throws raw ObjectDisposedException #369

Description

@thomhurst

Found in the pre-4.0 audit (follow-up to #360/#361). DX, not a blocker.

IAsyncEnumerableProcessor implementations are documented single-use and dispose their internal linked CancellationTokenSource when ExecuteAsync completes. A second ExecuteAsync call then hits the disposed CTS and surfaces a bare ObjectDisposedException (naming CancellationTokenSource), with no hint the processor is single-use. Result-streaming variants defer the failure to the first MoveNextAsync, making it even harder to trace.

Fix: guard ExecuteAsync entry: second call throws InvalidOperationException stating the processor is single-use; a call after explicit disposal throws ObjectDisposedException naming the processor type. No signature changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions