-
Notifications
You must be signed in to change notification settings - Fork 287
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
TelemetryClient.Flush deadlocks #1186
Comments
I'm encountering this issue on consistent basis. |
@macrogreg Can you take a look at this? I think it's related to the lock in MetricSeriesAggregatorBase.UpdateAggregate(): Lines 392 to 394 in f181abb
|
As a workaround, if you're not using the |
As per recommendation in API documentation, which discourages old metric patterns, we're using GetMetric() and TrackValue(). Hence, unfortunately, the above workaround would not help. |
This is one of the problems with Flush API and while this particular issue is pretty bad and we want to fix it along with Flush. This cycle we won't have the bandwidth for it, so moving it to the next milestone. |
I think I see the same issue with AI 2.4. |
@rafist Are you on asp.net core? then do the following to remove metric pre aggregator: If you are on Asp.Net, then comment out the following processor from AI.Config |
moving to next milestone, as there are no cycles to investigate this. |
Thanks @cijothomas, my issue was not related to the Flush after all. |
@rafist , Could you please share more details on actual issue. Could you please share details, if it is resolved for you. |
@cijothomas / @lmolkova / @TimothyMothra , We are using Log4Net, Application Insights Appender to log to App Insights. TelemetryClient.Flush method is called after every TelemetryClient.TrackTrace method. After a few hours/sometimes immediately, all other application API calls in my application are failing with Task Cancelled exceptions. When we disable the Application Insights Appender in the Log4net.config file, all my API calls are succeeding. We are using .NET Framework 4.6.2 and Application Insights Appender v2.11.0.0. it seems the Application Insights is blocking other API calls. My Application is an Azure Worker Role. Could you please let us know if this is the known issue in the Flush method. If yes, please kindly share any workaround and possible fix timelines. Thanks |
Moving further from current milestones. |
+1 A similar/probably same issue was reported outside of this repo. The issue is already tagged p1, but not yet assigned a milestone. Will mark for the next release. |
2.17 release date is not yet announced. Will update here, once a firm date is set. |
@cijothomas are you sure this will be resolved in 2.17? I've noticed the milestone for this issue keeps getting pushed out. As a potential work around, do you think we could try invoking |
@shoguns6 It looks like you are reporting a different issue than the Flush deadlocks. Metrics aggregator (DefaultAggregationPeriodCycle) is only expected to create one Thread. If you are seeing more than one (461 in your screenshot), it likely means TelemetryConfig/Client is being recreated instead of re-using. Could you check if this is possible in your application. |
One more +1 as this was reported by another user. |
A tactical fix can be made to prevent Flush from waiting (Spinning) indefinitely. It should avoid the currently reported deadlock situations. |
Just another data point, we also have this problem. We have experienced it randomly since at least early 2021. Quite frustrating that it has not been possible to fix it even after 20 point releases of AI. |
Customer request to add this item to 2.21 release if possible. |
Same problem here. We had it two weeks ago for the first time using 2.18. We had is consistently multiple times during the day on different servers so we upgraded to 2.20 and yesterday this issue occured again. We have to leave Application Insights disabled for now, which is not ideal. |
Hello All, |
Hello All, |
We have created a backlog item to upgrade the SDK and test the fix. |
If anyone who experienced this issue can confirm that the latest version fixes the issue, it would be greatly appreciated. |
Apologies for the delay. We have this scheduled for the upcoming sprint, since we saw the deadlock again in integration. So we will upgrade to the new library.
…________________________________
From: Cijo Thomas ***@***.***>
Sent: Friday, September 16, 2022 2:44 PM
To: microsoft/ApplicationInsights-dotnet ***@***.***>
Cc: [ɴιɴlαr] ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/ApplicationInsights-dotnet] TelemetryClient.Flush deadlocks (#1186)
If anyone who experienced this issue can confirm that the latest version fixes the issue, it would be greatly appreciated.
—
Reply to this email directly, view it on GitHub<#1186 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAIHCW3I6CHO43Q6NYIZQP3V6TS5RANCNFSM4IISHSYA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
We have the latest version now running for 5 months, and the issue did not occur anymore. Thanks for looking into it. |
If you are reporting bug/issue, please provide detailed Repro instructions.
Repro Steps
Actual Behavior
The app deadlocks during Flush operation.
Occurrence is reliably about 1 in 8000 runs in a consistent hardware and deployment environment.
Expected Behavior
not deadlock
Version Info
SDK Version : appinsights 2.10.0
.NET Version : netcore 2.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS : win10-x64
Hosting Info (IIS/Azure WebApps/ etc) : console
Two stacks seem relevant for this:
Thread1
Thread 2
The text was updated successfully, but these errors were encountered: