Skip to content

Commit 6648b7c

Browse files
committed
fix: Don't block on sending envelopes (ureq/curl transports)
1 parent 91de703 commit 6648b7c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Fixes**:
6+
7+
- Envelopes will be discarded rather than blocking if the transport channel fills up (previously fixed in async-capable transports, now applied to the curl/ureq transports). ([#701](https://github.com/getsentry/sentry-rust/pull/701))
8+
39
## 0.34.0
410

511
**Features**:

Diff for: sentry/src/transports/thread.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ impl TransportThread {
7474
}
7575

7676
pub fn send(&self, envelope: Envelope) {
77-
let _ = self.sender.send(Task::SendEnvelope(envelope));
77+
// Using send here would mean that when the channel fills up for whatever
78+
// reason, trying to send an envelope would block everything. We'd rather
79+
// drop the envelope in that case.
80+
if let Err(e) = self.sender.try_send(Task::SendEnvelope(envelope)) {
81+
sentry_debug!("envelope dropped: {e}");
82+
}
7883
}
7984

8085
pub fn flush(&self, timeout: Duration) -> bool {

0 commit comments

Comments
 (0)