Skip to content

Commit

Permalink
client: log last error on subchannel connectivity change (#6109)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-matyukevich committed Mar 15, 2023
1 parent 36fd0a4 commit a1e657c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clientconn.go
Expand Up @@ -1113,7 +1113,11 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error)
return
}
ac.state = s
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s)
if lastErr == nil {
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s)
} else {
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v, last error: %s", s, lastErr)
}
ac.cc.handleSubConnStateChange(ac.acbw, s, lastErr)
}

Expand Down

0 comments on commit a1e657c

Please sign in to comment.