-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
fix: Don't block on sending envelopes #546
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #546 +/- ##
==========================================
- Coverage 70.88% 70.87% -0.02%
==========================================
Files 66 66
Lines 6623 6624 +1
==========================================
Hits 4695 4695
- Misses 1928 1929 +1 |
@@ -85,7 +85,12 @@ impl TransportThread { | |||
} | |||
|
|||
pub fn send(&self, envelope: Envelope) { | |||
let _ = self.sender.send(Task::SendEnvelope(envelope)); | |||
// Using send here would mean that when the channel fills up for whatever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JS we indeed just drop the envelope - https://github.com/getsentry/sentry-javascript/blob/e497bcda305a9c248dcdc78f48fe548cc58f8233/packages/core/src/transports/base.ts#L93-L104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using sentry_debug
is a better idea in that case I would say. It does need some locking to figure out is debug logging is enabled.
Fixes #543.
I am unsure if there is anything better than
eprintln
we can do in the error case—would using e.g. thesentry_debug
macro exacerbate the problem because it also tries to send on the same channel?