From 5090af97a29582076ed340c2aea978cecfaa7e7a Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Sat, 25 Jul 2026 05:28:44 +0200 Subject: [PATCH] fix(lib): give the login verdict the wait the caller already allows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The actor gave the server 5 seconds to answer a login before reporting Timeout, while Client::login documents and allows 45. Under load — 24 e2e tests sharing one soulfind — 5 seconds is not always enough, which is how CI failed on a docs-only commit. --- soulseek-rs-lib/src/actor/server_actor.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/soulseek-rs-lib/src/actor/server_actor.rs b/soulseek-rs-lib/src/actor/server_actor.rs index 2cea4fa..aef75ba 100644 --- a/soulseek-rs-lib/src/actor/server_actor.rs +++ b/soulseek-rs-lib/src/actor/server_actor.rs @@ -35,6 +35,11 @@ use std::time::{Duration, Instant}; use crate::{SoulseekRs, debug, error, trace, warn}; +/// Ceiling on the wait for the server's login verdict. A loaded server can +/// take seconds to answer, so this stays inside the caller's own 45s bound +/// rather than undercutting it. +const LOGIN_VERDICT_TIMEOUT: Duration = Duration::from_secs(30); + #[derive(Debug, Clone)] pub struct PeerAddress { host: String, @@ -642,12 +647,11 @@ impl ServerActor { )); let start = std::time::Instant::now(); - let timeout = Duration::from_secs(5); let context = self.context.clone(); std::thread::spawn(move || { loop { - if start.elapsed() >= timeout { + if start.elapsed() >= LOGIN_VERDICT_TIMEOUT { let _ = response.send(Err(SoulseekRs::Timeout)); break; }