Recently I discovered an uncertain behavior in Observable.FromAsync
method which causes unobserved exceptions to be thrown.
When there is an active subscription and task throws an exception everything works as expected - exception is catched by RX and forwarded to onError
handler. The problem happens when subscription is cancelled right before the task failure. Under the hood (inside SlowTaskObservable
) RX cancels task continuation, Exception
property is not accessed by anyone and when GC is triggered - task unobserved exception is thrown.
My main concerns here are next:
Select
(or anywhere else) and if subscription is cancelled at this point - exception is not forwarded anywhere and is "silently" ignored.Exception
property. But when subscription is cancelled behavior changes completely.TaskScheduler.UnobservedTaskException
. Any Observable.FromAsync
usage can cause an unobserved exception. This part is critical in my view.How I expect it to work: if RX creates a task and takes responsibility for error handling, it should do it fully from the beginning to the end. Behavior has to be consistent, no subscription means we are no longer interested in errors and we shouldn't get them anywhere.
firenero, iXab3r, lioobayoyo, quinmars, keozx and 9 moremsschl and zhaparoff
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4