fix(daemon): restore pooled connection timeout after short-timeout operations#638
Merged
fix(daemon): restore pooled connection timeout after short-timeout operations#638
Conversation
…erations Four functions (ping_daemon, get_session_status, get_session_info, read_scrollback) set a 2s read timeout on pooled IPC connections but never restored the default 30s before returning to the pool. The next caller on the same thread inherited the corrupted 2s timeout, causing spurious timeouts on slower operations. Save the original timeout before overriding, and restore it before returning the connection to the pool. If the restore fails, the connection is dropped rather than poisoning the pool. Add IpcConnection::get_read_timeout() to support the save/restore pattern.
Owner
Author
PR Review SummaryCritical Issues (0 found)None. Important Issues (1 found)
Suggestions (2 found)
Strengths
VerdictREADY TO MERGE -- The fix is correct, consistent, and well-tested. The DRY concern is real but appropriate as a follow-up, not a merge blocker for a targeted bug fix. Recommended Actions
|
…erations Replace 8 manual save/set/restore cycles across 4 functions with IpcConnection::with_read_timeout() — a closure-based helper that saves the original timeout, sets a short one, runs the caller's closure, and restores the original on return.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ping_daemon,get_session_status,get_session_info,read_scrollback) set a 2s read timeout on pooled IPC connections but never restored the 30s default before returning to the pool — the next caller on the same thread inherited the corrupted timeoutIpcConnection::get_read_timeout()getter to support the save/restore patternTest plan
test_get_read_timeout_returns_current_valueverifies round-trip save/set/restorecargo fmt --checkpassescargo clippy --all -- -D warningspassescargo test --allpasses (all 27 test suites)cargo build --allpasses