Skip to content

Commit

Permalink
rpc: Heartbeat local connections too
Browse files Browse the repository at this point in the history
Local connections can fail if the machine's network configuration
changes (for example, if you turn wifi off on a laptop). We disabled
heartbeating of local connections in cockroachdb#16526 to work around a UI issue
(in which the UI would fail to recover after a local connection
failed). This relied on GRPC's internal reconnections, which were
disabled in cockroachdb#22658. This commit re-enables local heartbeats so that
our reconnection logic works as usual (In the meantime, the UI has
gotten better about error recovery, so cockroachdb#16526 is no longer necessary).

Fixes cockroachdb#22951

Release note (bug fix): The admin UI no longer hangs after a node's
network configuration has changed.
  • Loading branch information
bdarnell committed Mar 5, 2018
1 parent 44b14d0 commit 0073a40
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pkg/rpc/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,6 @@ func (ctx *Context) GRPCDial(target string) *Connection {
conn.initOnce.Do(func() {
var redialChan <-chan struct{}
conn.grpcConn, redialChan, conn.dialErr = ctx.GRPCDialRaw(target)
if ctx.GetLocalInternalServerForAddr(target) != nil {
conn.heartbeatResult.Store(heartbeatResult{err: nil, everSucceeded: true})
conn.setInitialHeartbeatDone()
return
}
if conn.dialErr == nil {
if err := ctx.Stopper.RunTask(
ctx.masterCtx, "rpc.Context: grpc heartbeat", func(masterCtx context.Context) {
Expand Down

0 comments on commit 0073a40

Please sign in to comment.