FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

AsyncObseravableBase: Fix in case of exceptions thrown synchronously by fedeAlterio · Pull Request #2213 · dotnet/reactive · GitHub

AsyncObseravableBase: Fix in case of exceptions thrown synchronously - #2213

Open
fedeAlterio wants to merge 5 commits into
dotnet:mainfrom
fedeAlterio:fix/synchronous-exceptions-asyncobservable
Open

fedeAlterio wants to merge 5 commits into
dotnet:mainfrom
fedeAlterio:fix/synchronous-exceptions-asyncobservable

Conversation

fedeAlterio commented Aug 24, 2025 •
edited
Loading

Copy link
Copy Markdown

IAsyncObserver<T> OnNextAsync, OnCompletedAsync and OnErrorAsync can all throw exceptions synchronously,
This is not handled correctly in AsyncObseravableBase, and the execution flow will follow a different path of the asynchronous one.

A concrete issue caused by this, is that if a synchoronous exception is thrown inside OnCompleteAsync, AutoDetachAsyncObserver will not Dispose the subscription automatically

Fixes also reentrancy issues when Disposing while in the middle of an On*Async call

fedeAlterio force-pushed the fix/synchronous-exceptions-asyncobservable branch from 83a0b5c to b0a3736 Compare August 24, 2025 12:28
fedeAlterio force-pushed the fix/synchronous-exceptions-asyncobservable branch from b0a3736 to f25ab7d Compare August 24, 2025 12:38

Copy link
Copy Markdown
Author

@idg10 There isn’t an open issue for these problems, but the code comments describe them in detail.
Would you prefer that I create a separate issue to document and track them outside of this PR?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL