Comments (12)
I can confirm with high probability this exception is thrown when the client cancels the request. If I find some time, I will implement some handling logic for this in http request middleware.
from applicationinsights-owinextensions.
Version 0.8.0 will now by default filter OperationCancelledException
when the current request is marked as cancelled.
from applicationinsights-owinextensions.
Hi,
Are you using getContextProperties
delegate in order to extract additional information from request? If so, then what is that you do exactly?
from applicationinsights-owinextensions.
hi Marcin,
https://www.blogger.com/comment.g?blogID=4923273354692358330&postID=2036195216408138414&page=1&token=1500908631925
as in my post there, this looks same and is also happening under high load.
from applicationinsights-owinextensions.
For a reference I will paste my exception here too:
System.OperationCanceledException: at System.Threading.CancellationToken.ThrowOperationCanceledException (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Web.Http.Owin.HttpMessageHandlerAdapter+d__20.MoveNext (System.Web.Http.Owin, Version=5.2.3.0, ... at System.Web.Http.Owin.HttpMessageHandlerAdapter+d__0.MoveNext (System.Web.Http.Owin, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at ApplicationInsights.OwinExtensions.RestoreOperationIdContextMiddleware+d__1.MoveNext (ApplicationInsights.OwinExtensions, Version=0.4.1.0, Culture=neutral, PublicKeyToken=null) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage+d__5.MoveNext (Microsoft.Owin.Host.SystemWeb, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware
1+d__0.MoveNext (Microsoft.Owin.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at IdentityServer3.AccessTokenValidation.IdentityServerBearerTokenValidationMiddleware+d__8.MoveNext (IdentityServer3.AccessTokenValidation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at ApplicationInsights.OwinExtensions.HttpRequestTrackingMiddleware+d__4.MoveNext (ApplicationInsights.OwinExtensions, Version=0.4.1.0, Culture=neutral, PublicKeyToken=null) `
from applicationinsights-owinextensions.
Hi. The answer is that this exception in AI was thrown because of the IIS worker client disconnected exception. Because of that app was not able to read request info and was thrown Operation canceled exception.
from applicationinsights-owinextensions.
Some research I did on SO also suggests this may be related to client prematurely disconnecting. However I was not able to reproduce these conditions on my machine. I'm going to leave this issue open for a while, maybe someone will be able to provide more information.
from applicationinsights-owinextensions.
Same exception occurs in 2020 with version 0.6.0.
UPDATE: Pattern is similar to described below, but exact numbers could be exaggerated due to Azure AppInsights sampling and estimating exceptions count based on samples. I can clearly see 1-4 consequtive samples within few seconds.
UPDATE 2: Found a point which cannot be explained with sampling: thousands of exceptions per minute:
The pattern is that exceptions occur in batches: it can be many days with no exceptions, and then boom: couple of hundred exceptions in just a few minutes (1-2 minute spikes usually). And then back to normal behavior (0-exception) for some time, and again boom - hundreds of exceptions per minute.
Strange correlation with CPU load discovered:
Although there might be 3rd factor influencing both correlating parameters (e.g. requests count, although it didn't grow that much):
from applicationinsights-owinextensions.
Thanks for quick reply, @marcinbudny !
A collegue of mine also told they had this issue due to client timeout. And many failing requests indeed are long-running (up to couple of minutes). But at the same time there are some requests which fail in just miliseconds (even 8ms).
from applicationinsights-owinextensions.
The 0.8.0 fix may also solve the problem with ObjectDisposedException
that I wasn't able to reproduce. If you experienced this problem, please let me know.
from applicationinsights-owinextensions.
Thank you so much for the fix, @marcinbudny ! We'll update to the latest version and check how it works.
from applicationinsights-owinextensions.
Closing due to lack of activity
from applicationinsights-owinextensions.
Related Issues (20)
- Add paramters from OwinContext? HOT 4
- When to remove the optional TelemetryInitializers HOT 2
- HTTP 500s not being logged HOT 4
- Support for DependencyCollector? HOT 3
- Assembly Not Signed HOT 3
- Service Fabric Owin OperationIdContext is null HOT 3
- Support for getContextPropertiesAsync HOT 5
- Support HTTP Protocol for Correlation HOT 4
- Set requestId and parentId to correlate dependencies to requests in the azure portal HOT 7
- System.OperationCanceledException and System.ObjectDisposedException HOT 8
- Could not install package 'ApplicationInsights.OwinExtensions 0.6.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2' HOT 2
- System.Threading.Tasks.TaskCancelledException: HOT 7
- ObjectDisposedException at ApplicationInsights.OwinExtensions.HttpRequestTrackingMiddleware HOT 11
- This extension killed my webapp performance HOT 5
- How to set the user context of RequestTelemetry HOT 1
- Nuget package is missing strong name HOT 1
- operation_Name Missing From Custom Event Data HOT 4
- ApplicationInsights.OwinExtensions.HttpRequestTrackingMiddleware+<Invoke>d__4.MoveNext HOT 1
- Conflicting version of Microsoft.Owin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-owinextensions.