Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Envelopes will be discarded rather than blocking if the transport channel fills up. ([#546](https://github.com/getsentry/sentry-rust/pull/546))

## 0.29.2

### Various fixes & improvements
Expand Down
7 changes: 6 additions & 1 deletion sentry/src/transports/tokio_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

// reason, trying to send an envelope would block everything. We'd rather
// drop the envelope in that case.
if let Err(e) = self.sender.try_send(Task::SendEnvelope(envelope)) {
sentry_debug!("envelope dropped: {e}");
}
}

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