-
Notifications
You must be signed in to change notification settings - Fork 72
NullReferenceException in ActiveHandlerTrackingEntry with 2.2.0 preview 3 #194
Comments
It's also not a one-off, as we run these tests in batches based on categories to get some parallelism across TeamCity jobs, and 4 different jobs (of 7) have all failed with the same exception. |
Ah yes. It's probably the case that we need to null check the timer when we access it. This was a 2.2.0 change. |
Is there any workaround for this? All of our preview 3 containers terminate every few minutes with this error. |
Looking at the code, I think the only workaround is to make the messsge handler lifetimes either Infinite or really long (~the usual lifetime of your containers). |
This issue here is that we were allowing multiple timers to start because we never set `_timerInitialized`. This is a regression during the milestone from introducing NonCapturingTimer.
This issue here is that we were allowing multiple timers to start because we never set `_timerInitialized`. This is a regression during the milestone from introducing NonCapturingTimer.
Fixed this for 2.2 - sorry I don't think there's a workaround here. This is just broken. What happens is that an additional timer is started each time you request an HTTP client within the lifetime of a single handler. |
Ok, might be worth adding it to the known issues. Preview 3 is probably a skip for most microservice-ish apps. |
Yeah that's a fair point, will do. |
Added aspnet/Announcements#323 |
I don't yet have a repro, but I've just updated an ASP.NET Core web app that uses IHttpClientFactory to 2.2.0 preview 3, and I've got some in-memory self-hosted tests failing because of the following exception causing
dotnet test
to terminate:I guess that one of either
_timer
or_callback
is somehownull
:HttpClientFactory/src/Microsoft.Extensions.Http/ActiveHandlerTrackingEntry.cs
Lines 75 to 87 in 5255a24
The text was updated successfully, but these errors were encountered: