You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WaitForCompletion waits for a task to complete with a timeout, and allows you to specify a handler for the timeout case. However, once the timeout has occurred it ditches the task, which means if that task later completes with whatever error caused it to timeout, the exception will be unobserved, and the UnobservedTaskException event will fire.
As AsyncHelper is internal, the bug wasn't experienced directly, but certain timeout conditions in Sql connections would lead to unobserved exceptions. My former employer had a policy of no unobserved exceptions, and so had a handler that killed the application when they occurred. We worked around this at the time by changing the handler to ignore this type of exception, and it's only now I'm finding time to file a proper bug report.
The text was updated successfully, but these errors were encountered:
This is a good catch. I will test your branch locally to validate your changes. Meanwhile, please feel free to create the PR so we can review it properly.
To reproduce
I have a reproduction of the issue along with a possible fix here:
master...jm771:ReproUnobservedException
Bug description
WaitForCompletion waits for a task to complete with a timeout, and allows you to specify a handler for the timeout case. However, once the timeout has occurred it ditches the task, which means if that task later completes with whatever error caused it to timeout, the exception will be unobserved, and the UnobservedTaskException event will fire.
As AsyncHelper is internal, the bug wasn't experienced directly, but certain timeout conditions in Sql connections would lead to unobserved exceptions. My former employer had a policy of no unobserved exceptions, and so had a handler that killed the application when they occurred. We worked around this at the time by changing the handler to ignore this type of exception, and it's only now I'm finding time to file a proper bug report.
The text was updated successfully, but these errors were encountered: