Skip to content

Commit a1e657c

Browse files
client: log last error on subchannel connectivity change (#6109)
1 parent 36fd0a4 commit a1e657c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clientconn.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,11 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error)
11131113
return
11141114
}
11151115
ac.state = s
1116-
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s)
1116+
if lastErr == nil {
1117+
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s)
1118+
} else {
1119+
channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v, last error: %s", s, lastErr)
1120+
}
11171121
ac.cc.handleSubConnStateChange(ac.acbw, s, lastErr)
11181122
}
11191123

0 commit comments

Comments
 (0)