Skip to content
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

No logger logging #372

Merged
merged 2 commits into from
Nov 19, 2019
Merged

No logger logging #372

merged 2 commits into from
Nov 19, 2019

Conversation

mitchellhenke
Copy link
Contributor

The cause of #371 is that logging from within the Sentry.LoggerBackend can deadlock Logger itself. When Logger receives a bunch of messages and can't process them fast enough, it switches into synchronous mode (default is queue length of 20). This means when Sentry.LoggerBackend tries to log while Logger is in synchronous mode, it will deadlock because Sentry.LoggerBackend is waiting for Logger to return a response while Logger is waiting for Sentry.LoggerBackend to process messages.

I started a little bit of a refactor in how Client handles errors to separate the Logger pieces from the Client to potentially make changes going forward, but the fix is relatively straightforward for now in that if the event_source on the event is the LoggerBackend, we don't log.

I'm not expecting many users to see this, especially in production, but this is dangerous behavior that should not be possible 🙂

closes #371

@@ -78,7 +78,7 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
hackney_opts: [recv_timeout: 50]

Sending test event...
Error sending event!
Error sending event: "Received 500 from Sentry server: "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prolly dont need the the last colon after server/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unreachable/misconfigured Sentry hangs the Elixir app
2 participants