From 363c056bab279def9e459248158cc26c6bc30ae2 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sat, 21 Mar 2026 14:37:04 -0300 Subject: [PATCH] fix(bootstrap): add strict timeout to Redis connection initialization to prevent hanging on dropped tcp packets --- src/main_module/bootstrap.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main_module/bootstrap.rs b/src/main_module/bootstrap.rs index 826ba7e1..5f00fefc 100644 --- a/src/main_module/bootstrap.rs +++ b/src/main_module/bootstrap.rs @@ -296,8 +296,9 @@ pub async fn init_redis() -> Option> { let result = tokio::task::spawn_blocking(move || { match redis::Client::open(cache_url_clone.as_str()) { Ok(client) => { - // Verify the connection actually works - match client.get_connection() { + // Verify the connection actually works with a strict timeout to avoid hanging on DROP rules + let timeout = std::time::Duration::from_secs(3); + match client.get_connection_with_timeout(timeout) { Ok(mut conn) => { // Test with PING match redis::cmd("PING").query::(&mut conn) {