Reduce RPC dial timeout from 2s to 200ms for fast-fail (bd-expt)
- Changed TryConnect default from 2s to 200ms - Updated fallback timeout in TryConnectWithTimeout - Complements bd-wgu4 lock probe to eliminate 5s delays - Fixes GH#243 (5s delay when daemon socket missing) - Health checks still use longer timeouts via explicit TryConnectWithTimeout calls
This commit is contained in:
@@ -29,7 +29,7 @@ type Client struct {
|
||||
// TryConnect attempts to connect to the daemon socket
|
||||
// Returns nil if no daemon is running or unhealthy
|
||||
func TryConnect(socketPath string) (*Client, error) {
|
||||
return TryConnectWithTimeout(socketPath, 2*time.Second)
|
||||
return TryConnectWithTimeout(socketPath, 200*time.Millisecond)
|
||||
}
|
||||
|
||||
// TryConnectWithTimeout attempts to connect to the daemon socket using the provided dial timeout.
|
||||
@@ -54,7 +54,7 @@ func TryConnectWithTimeout(socketPath string, dialTimeout time.Duration) (*Clien
|
||||
}
|
||||
|
||||
if dialTimeout <= 0 {
|
||||
dialTimeout = 2 * time.Second
|
||||
dialTimeout = 200 * time.Millisecond
|
||||
}
|
||||
|
||||
conn, err := dialRPC(socketPath, dialTimeout)
|
||||
|
||||
Reference in New Issue
Block a user