-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ConsoleLogger Queue optimization can lead to missed log entries #79812
Comments
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsDescription
More details: #70186 (comment) Reproduction StepsJust manual code analysis for now (after one of our integration test broke with runtime upgrade). FYI @vlada-shubina - as she started to dig into our broken test and pointed the focus to the recent console logger queue behavior change Expected behaviorAll logged items, that are logged prior calling Actual behaviorSome already logged items can be skipped (and not flushed) after calling Regression?Yes Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
IMHO, I don't think that |
It would be nice if
I can imagine there can be many important messages on shutdown of a long running service ("was the state preserved?", "Was the shutdown acknowledged by other services?" etc.), that user might want to see (e.g. when deploying containerized apps and redirecting container output to persistnet cloud logs). We are anyway already waiting with timeout for the flushing thread in the if (_messageQueue.Count > 0 && !_isAddingCompleted) ---> if (_messageQueue.Count > 0) That would at least spare the need for the question 2 above. |
would you be willing to send a PR with the fix and some tests? |
Description
CompleteAdding
andTryDequeue
try to compete for same lock. OnceCompleteAdding
wins, no more entries are being logged despite there might still be some in the queue.More details: #70186 (comment)
Reproduction Steps
Just manual code analysis for now (after one of our integration test broke with runtime upgrade).
We can work on repro if needed.
FYI @vlada-shubina - as she started to dig into our broken test and pointed the focus to the recent console logger queue behavior change
Expected behavior
All logged items, that are logged prior calling
Dispose
are being flushed after callingDispose
. No items are skipped.Actual behavior
Some already logged items can be skipped (and not flushed) after calling
Dispose
Regression?
Yes
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: