Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing stack trace on UnobservedTaskException #2067

Merged
merged 4 commits into from
Dec 2, 2022

Conversation

mattjohnsonpint
Copy link
Contributor

Fixes #2065

@mattjohnsonpint mattjohnsonpint merged commit bd24329 into main Dec 2, 2022
@mattjohnsonpint mattjohnsonpint deleted the fix-taskunobservedexceptiondetails branch December 2, 2022 02:27
@christallire
Copy link

Could we get this released ASAP? I have too many UnobservedTaskException without stack traces

@mattjohnsonpint
Copy link
Contributor Author

mattjohnsonpint commented Dec 15, 2022

Yes, there will be a release very soon, probably tomorrow. Thanks for your patience.

@mattjohnsonpint
Copy link
Contributor Author

mattjohnsonpint commented Dec 16, 2022

@christallire, @dbruning - 3.24.1 has been release which includes this fix. Please update and let us know how it goes. Thanks.

@brnbs
Copy link

brnbs commented Apr 2, 2023

@mattjohnsonpint I am not sure if it's related, but I am using Sentry.AspNetCore 3.29.1 nuget and all the issues I get via UnobservedTaskException mechanism have a very short stack trace:

OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:61414/
  ?, in void DriverService.Start()
  File "Task.cs", line 2381, in void Task.ExecuteWithThreadLocal(ref Task currentTaskSlot, Thread threadPoolThread)
System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request.
  File "Socket.Tasks.cs", line 1451, in void AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
  File "ValueTask.cs", line 271, in void ValueTaskSourceAsTask.s_completionAction(object state)

Is there any way to fix this?

@mattjohnsonpint
Copy link
Contributor Author

mattjohnsonpint commented Apr 2, 2023

@brnbs - That's not related to this.

You appear to have a legitimate unobserved task exception related to Selenium web driver not being able to start the driver service. That particular exception is thrown from here.

As to why it's unobserved, I can't exactly say. At first glance, that doesn't appear to be in called in an async code path within that library. Given the short stack trace, I can only guess that something like Task.Run(() => SomeDriverService.Start()) is being called somewhere else.

At any rate, I don't believe there's any Sentry issue here. Thanks.

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.

UnobservedTaskExceptionIntegration could provide a stack trace (but doesn't)
4 participants