`Transport::flush` on an `Arc<T>` transport returns `true` without flushing `T`
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 85/100
Línea de trabajo
Lee sentry-core/src/transport/mod.rs, especialmente la implementación de Transport para Arc<T> y el flush predeterminado del trait. Confirma el comportamiento con la reproducción del issue, donde NeverDrains::flush devuelve false. La tarea está completa cuando hacer flush a través de Arc<T> devuelve el resultado del transporte envuelto; revisa también las pruebas de transports cercanos, si las hay.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
How do you use Sentry?
Sentry SaaS (sentry.io)
SDK version
0.49.5, and master at 12c8785008a9046ddb73a238349c95447e78dde4
Steps to reproduce
impl<T: Transport> Transport for Arc<T> forwards send_envelope and shutdown to T but not flush, so flush called through an Arc<T> runs the trait's default, which returns true at once.
-
A binary with this
Cargo.toml:[package] name = "arc-transport-flush" version = "0.1.0" edition = "2024" publish = false [dependencies] sentry-core = { git = "https://github.com/getsentry/sentry-rust", rev = "12c8785008a9046ddb73a238349c95447e78dde4" } [workspace]and this
src/main.rs, whose transport'sflushalways reports envelopes left behind:use std::sync::Arc; use std::time::Duration; use sentry_core::{Envelope, Transport}; /// A transport whose queue never drains, so every flush reports envelopes left behind. struct NeverDrains; impl Transport for NeverDrains { fn send_envelope(&self, envelope: Envelope) { let _ = envelope; } fn flush(&self, _timeout: Duration) -> bool { false } } fn main() { let direct = Transport::flush(&NeverDrains, Duration::ZERO); let through_arc = Transport::flush(&Arc::new(NeverDrains), Duration::ZERO); let shutdown_through_arc = Transport::shutdown(&Arc::new(NeverDrains), Duration::ZERO); println!("flush on the transport: {direct}"); println!("flush on Arc<transport>: {through_arc}"); println!("shutdown on Arc<transport>: {shutdown_through_arc}"); } -
cargo run
Expected result
flush on Arc<transport>: false, what flush on the transport itself returns.
Actual result
flush on the transport: false
flush on Arc<transport>: true
shutdown on Arc<transport>: false
rustc 1.99.1 on Windows 11 x64. A caller told by flush through the Arc that the queue drained can end the process with envelopes still queued in T.
- Lenguaje dominante
- Rust
- Estrellas
- 755
- Forks
- 192
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-rust
-
breaking change
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
getsentry/sentry-rust#1387 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
breaking change Rust
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-rust#1386 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
breaking change Rust Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
getsentry/sentry-rust#1345 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Pin Rust toolchainAbiertoRust Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
getsentry/sentry-rust#933 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Make the `sentry` crate's `serde_json` feature a no-opPosiblemente ocupada @sentry-junior la tomó hace 1 día. AbiertoRust
Dificultad 1/5 1-3 horas Aptitud para principiantes 25/100
getsentry/sentry-rust#1385 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de getsentry/sentry-rust
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Y-ASLant/ElegantClipboard#178 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
linxiv-dev/linXiv#384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug drawings ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
userFRM/egui-charts#1595 ·
Los mantenedores suelen responder en 1 día
-
tcp: a very large keep-alive interval overflows `Instant` arithmetic (panic in debug builds)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
smoltcp-rs/smoltcp#1235 ·
Los mantenedores suelen responder en 1 día
-
scope:core type:security
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día