[client] Reset gRPC channel backoff when the network returns

Dials attempted by the gRPC channel while offline grow its internal
exponential backoff, so after the network came back the reconnect loop sat
in WaitForStateChange until that timer expired. Reset the channel backoff
alongside the retry backoff so the management and signal reconnects dial
immediately.
This commit is contained in:
Zoltán Papp
2026-08-19 17:40:42 +02:00
committed by Zoltan Papp
parent 6639f7bf97
commit acdeb385a9
2 changed files with 6 additions and 0 deletions

View File

@@ -233,6 +233,9 @@ func (c *GrpcClient) withMgmtStream(
return nil //nolint:nilerr // a cancelled context means shutdown, not a retryable failure
} else if waited {
backOff.Reset()
// dials attempted while offline grew the channel's internal backoff;
// reset it too, or the reconnect waits out that timer first
c.conn.ResetConnectBackoff()
}
connState := c.conn.GetState()

View File

@@ -197,6 +197,9 @@ func (c *GrpcClient) Receive(ctx context.Context, msgHandler func(msg *proto.Mes
return nil
} else if waited {
backOff.Reset()
// dials attempted while offline grew the channel's internal backoff;
// reset it too, or the reconnect waits out that timer first
c.signalConn.ResetConnectBackoff()
}
c.notifyStreamDisconnected()