fix(client): return after liveness reconnect to avoid deadlock #72

This commit is contained in:
zarazaex69
2026-05-25 23:33:51 +03:00
parent 9597a4ebb6
commit 743dc5c1bf

View File

@@ -371,6 +371,12 @@ func (c *Client) handleReconnect(ctx context.Context, cfg Config, cancel context
// reconnect callback which then drives a fresh handshake.
if reason == "liveness" && c.ln != nil {
c.ln.Reconnect("liveness")
// Return immediately — retryHandshake over the dead link would
// loop forever with "open control stream: timeout" while holding
// reconnectMu, blocking the carrier callback that fires once the
// link is actually back up. Let that callback (reason="carrier")
// drive the handshake when the transport is ready.
return
}
c.retryHandshake(ctx, cfg, cancel, reason)