-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Logger never gets out of :discard mode #9028
Comments
Note we only discard future messages. Whatever is in the inbox will still have to be processed and that should set the threshold back. Unless your whole inbox is filled with messages that are not log messages. But that would be a very pathological case. Do you have any idea why the system could be running into this issue? |
Btw, note this issue does not happen in master as we have descentralized the mode computation. |
Indeed, I didn't think of that. It goes like this:
I assumed we started to experience log drops when crashes happen because SentryLogger was slowing down log events processing by reporting each crash to Sentry. This is fine for a short time but obviously I expected logging to resume. I looked into the Senty client code (https://github.com/getsentry/sentry-elixir/blob/master/lib/sentry/client.ex) - they use Task to send messages so I believe it is possible that each reported crash pushed another non-log messages into the inbox. |
@mitchellhenke Since you are using |
Oops, yep! |
@mitchellhenke perfect! Let me know if you want me to review something. I also have a PR to fix this issue on Elixir side here: #9029. Once that is merged I will release a new v1.8. |
Environment
Erlang/OTP 21
Elixir 1.8.1
Current behavior
When the message queue size exceeds the discard threshold Logger enters into the discard mode with a message like that:
From that moment on all log messages are discarded until the app is restarted
I believe I found what the problem is.
Logger's mode is updated when a new event arrives here:
https://github.com/elixir-lang/elixir/blob/v1.8/lib/logger/lib/logger/config.ex#L78-L102
But when Logger enters the
:discard
mode, all log messages are dropped and no event get generated:https://github.com/elixir-lang/elixir/blob/v1.8/lib/logger/lib/logger.ex#L672-L678
So it seems that after entering a
:discard
mode Logger can't get out of it and all the log messages are dropped.Expected behavior
After the Logger's message queue gets under the discard threshold Logger's mode should be updated appropriately.
The text was updated successfully, but these errors were encountered: