relocate check for shutdown in ac.tearDown() (#1723)
This commit is contained in:
Родитель
5ff10c3b65
Коммит
98b17f20a2
|
@ -1333,6 +1333,9 @@ func (ac *addrConn) tearDown(err error) {
|
|||
ac.cancel()
|
||||
ac.mu.Lock()
|
||||
defer ac.mu.Unlock()
|
||||
if ac.state == connectivity.Shutdown {
|
||||
return
|
||||
}
|
||||
ac.curAddr = resolver.Address{}
|
||||
if err == errConnDrain && ac.transport != nil {
|
||||
// GracefulClose(...) may be executed multiple times when
|
||||
|
@ -1341,9 +1344,6 @@ func (ac *addrConn) tearDown(err error) {
|
|||
// address removal and GoAway.
|
||||
ac.transport.GracefulClose()
|
||||
}
|
||||
if ac.state == connectivity.Shutdown {
|
||||
return
|
||||
}
|
||||
ac.state = connectivity.Shutdown
|
||||
ac.tearDownErr = err
|
||||
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
|
||||
|
|
Загрузка…
Ссылка в новой задаче