Summary
spawn_passive_check() in src/update.rs calls handle.join() which blocks the main thread indefinitely, despite its name and doc comment claiming it runs as a non-blocking background check that "abandons" the thread after 3 seconds.
Details
The current implementation:
pub fn spawn_passive_check() {
let handle = std::thread::spawn(passive_version_check);
let _ = handle.join(); // blocks indefinitely
}
The doc comment states:
Waits at most 3 seconds for the check to complete. If it doesn't finish, the thread is abandoned (it dies when the process exits).
However, std::thread::JoinHandle::join() has no timeout — it blocks the calling thread until the spawned thread terminates. The 3-second bound only holds because the HTTP client uses PASSIVE_CHECK_TIMEOUT (3s), but DNS resolution stalls or other pre-connection delays could cause longer blocks.
This runs on every successful bugatti test invocation (if code == EXIT_OK), adding up to 3+ seconds of exit delay.
Suggested fix
Either:
- Fire-and-forget: Drop the
join() entirely — let _ = std::thread::spawn(passive_version_check); and let the thread die when the process exits.
- Timed wait: Use a channel with
recv_timeout to implement an actual 3-second deadline.
Found during code review of #12.
Summary
spawn_passive_check()insrc/update.rscallshandle.join()which blocks the main thread indefinitely, despite its name and doc comment claiming it runs as a non-blocking background check that "abandons" the thread after 3 seconds.Details
The current implementation:
The doc comment states:
However,
std::thread::JoinHandle::join()has no timeout — it blocks the calling thread until the spawned thread terminates. The 3-second bound only holds because the HTTP client usesPASSIVE_CHECK_TIMEOUT(3s), but DNS resolution stalls or other pre-connection delays could cause longer blocks.This runs on every successful
bugatti testinvocation (if code == EXIT_OK), adding up to 3+ seconds of exit delay.Suggested fix
Either:
join()entirely —let _ = std::thread::spawn(passive_version_check);and let the thread die when the process exits.recv_timeoutto implement an actual 3-second deadline.Found during code review of #12.