@@ -417,10 +417,10 @@ func (cc *ClientConn) validateTransportCredentials() error {
417417}
418418
419419// channelzRegistration registers the newly created ClientConn with channelz and
420- // stores the returned identifier in `cc.channelzID` and `cc.csMgr.channelzID`.
421- // A channelz trace event is emitted for ClientConn creation. If the newly
422- // created ClientConn is a nested one, i.e a valid parent ClientConn ID is
423- // specified via a dial option, the trace event is also added to the parent.
420+ // stores the returned identifier in `cc.channelz`. A channelz trace event is
421+ // emitted for ClientConn creation. If the newly created ClientConn is a nested
422+ // one, i.e a valid parent ClientConn ID is specified via a dial option, the
423+ // trace event is also added to the parent.
424424//
425425// Doesn't grab cc.mu as this method is expected to be called only at Dial time.
426426func (cc * ClientConn ) channelzRegistration (target string ) {
@@ -492,10 +492,10 @@ func getChainStreamer(interceptors []StreamClientInterceptor, curr int, finalStr
492492}
493493
494494// newConnectivityStateManager creates an connectivityStateManager with
495- // the specified id .
496- func newConnectivityStateManager (ctx context.Context , id * channelz.Channel ) * connectivityStateManager {
495+ // the specified channel .
496+ func newConnectivityStateManager (ctx context.Context , channel * channelz.Channel ) * connectivityStateManager {
497497 return & connectivityStateManager {
498- channelz : id ,
498+ channelz : channel ,
499499 pubSub : grpcsync .NewPubSub (ctx ),
500500 }
501501}
@@ -1548,16 +1548,6 @@ func (ac *addrConn) tearDown(err error) {
15481548 ac .cancel ()
15491549 ac .curAddr = resolver.Address {}
15501550
1551- if err == errConnDrain && curTr != nil {
1552- // GracefulClose(...) may be executed multiple times when
1553- // i) receiving multiple GoAway frames from the server; or
1554- // ii) there are concurrent name resolver/Balancer triggered
1555- // address removal and GoAway.
1556- // We have to unlock and re-lock here because GracefulClose => Close => onClose, which requires locking ac.mu.
1557- ac .mu .Unlock ()
1558- curTr .GracefulClose ()
1559- ac .mu .Lock ()
1560- }
15611551 channelz .AddTraceEvent (logger , ac .channelz , 0 , & channelz.TraceEvent {
15621552 Desc : "Subchannel deleted" ,
15631553 Severity : channelz .CtInfo ,
@@ -1633,34 +1623,6 @@ func (rt *retryThrottler) successfulRPC() {
16331623 }
16341624}
16351625
1636- /*
1637- func (c *channelzChannel) ChannelzMetric() *channelz.ChannelInternalMetric {
1638- cc := c.cc
1639- return &channelz.ChannelInternalMetric{
1640- State: cc.GetState(),
1641- Target: cc.target,
1642- CallsStarted: atomic.LoadInt64(&cc.czData.callsStarted),
1643- CallsSucceeded: atomic.LoadInt64(&cc.czData.callsSucceeded),
1644- CallsFailed: atomic.LoadInt64(&cc.czData.callsFailed),
1645- LastCallStartedTimestamp: time.Unix(0, atomic.LoadInt64(&cc.czData.lastCallStartedTime)),
1646- }
1647- }
1648-
1649- func (ac *addrConn) ChannelzMetric() *channelz.ChannelInternalMetric {
1650- ac.mu.Lock()
1651- addr := ac.curAddr.Addr
1652- ac.mu.Unlock()
1653- return &channelz.ChannelInternalMetric{
1654- State: ac.getState(),
1655- Target: addr,
1656- CallsStarted: atomic.LoadInt64(&ac.czData.callsStarted),
1657- CallsSucceeded: atomic.LoadInt64(&ac.czData.callsSucceeded),
1658- CallsFailed: atomic.LoadInt64(&ac.czData.callsFailed),
1659- LastCallStartedTimestamp: time.Unix(0, atomic.LoadInt64(&ac.czData.lastCallStartedTime)),
1660- }
1661- }
1662- */
1663-
16641626func (ac * addrConn ) incrCallsStarted () {
16651627 ac .channelz .ChannelMetrics .CallsStarted .Add (1 )
16661628 ac .channelz .ChannelMetrics .LastCallStartedTimestamp .Store (time .Now ().UnixNano ())
0 commit comments