[Bug]: Rust QueueEvents emits spurious "timed out" errors when idle
Version
1.2.9
Platform
rust
What happened?
QueueEvents's dedicated stream-reading connection uses redis-rs's default 500ms client-side response timeout. This is shorter than blocking_timeout (default 5000ms) passed to the underlying XREAD BLOCK call. On any queue idle for more than 500ms, the client abandons the blocking read and emits QueueEvent::Error { message: "timed out" }, even though nothing is wrong with the connection or the queue. This happens repeatedly (roughly every 500-600ms) for as long as the queue stays idle, and is indistinguishable from a genuine connection failure since QueueEvent::Error carries only a message string.
How to reproduce.
use bullmq::{QueueEvents, QueueEventsOptions};
#[tokio::main]
async fn main() {
let events = QueueEvents::with_options(
"some-queue",
QueueEventsOptions {
blocking_timeout: 2000,
..Default::default()
},
)
.await
.unwrap();
// Don't add any jobs to "some-queue".
while let Some(entry) = events.next_event().await {
println!("{:?}", entry.event);
}
}Relevant log output
Error { message: "timed out" }Code of Conduct
- I agree to follow this project's Code of Conduct
Fix implemented here: https://github.com/willrnch/bullmq/commit/4b4793a09bab44f97ccf7d8a1e024f9f4735a1be
I'm not allowed to create a PR here.
Source: taskforcesh/bullmq