Skip to content

ConfigureAwait(false) gaps in SelectMany/SelectManyAsync iterators #366

Description

@thomhurst

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

The library is otherwise consistent about ConfigureAwait(false), but the SelectMany/SelectManyAsync iterator families have gaps:

  • AsyncEnumerableExtensions: the await foreach (... .WithCancellation(ct)) loops (both outer and inner) omit .ConfigureAwait(false).
  • EnumerableExtensions.SelectManyAsync (IAsyncEnumerable-returning selector overloads): same pattern on the inner await foreach.

Impact: on a sync-context caller (classic ASP.NET, UI frameworks), continuations bounce through the captured context per item — a throughput hit and inconsistent with the rest of the library.

Fix: mechanical — add .ConfigureAwait(false) to each WithCancellation(...) enumeration in those methods. No behavior contract change.

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