-
Notifications
You must be signed in to change notification settings - Fork 10
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
Tenant idle shutdown trace is double-logged (NEST-490) #74
Comments
The docs say that you have to use Program.cs instead of Startup.cs the following way (almost like NLog): Currently without the idle tenant shutdown feature it means that each tenant has one added, that could also make sense if we want to provide a way to have different connection strings for each tenant. But looking at ILoggerFactory, that contains all providers for all tenants, I'm not even sure if that's even currently the good implementation for that https://learn.microsoft.com/en-us/azure/architecture/guide/multitenant/service/application-insights. With idle tenant shutdown feature on, the context is released then the site is started again with another logger provider added. This looks like the following in the memory. These TelemetryConfiguration instances are never garbage collected, so they will be put from Heap 0 to Heap 2 and they will stay there and new ones will do the same. It’s because ILoggerFactory and every ILoggerProvider added to it are never disposed. I suppose that’s because the Default tenant are never shut down and should not be. Btw I’ve never reproduced this issue because it seems like a simple GET call with HttpClient won’t trigger some logic that a manual page load does (weird, and I don’t know why). So the test controller for idle tenant shutdown didn’t repro this. Soooo I would go with the solution in the PRs, meaning we won’t support different connection strings for tenants. Technically we are doing it now, but with a bug I explained above. |
Let's switch to application-level AI, then. Should anything else in the module's Also, that logging in |
Just for info, this is the same kind of reasons that we needed to implement a |
Thanks for chiming in, JT! Yeah, that's similar, we're learning that the hard time now. But your findings and fixes, and Krisztián investigating these issues for months, have us now in a place where we can fix all of them for good :). |
The shutdown trace of
IdleShutdownTask
is double-logged (or even logged 3, 4, 5 times sometimes), and only with Application Insights. So, this is some bug in this module.Jira issue
The text was updated successfully, but these errors were encountered: