|
|
|
@ -617,8 +617,17 @@ void Chttp2ServerListener::ActiveConnection::Start( |
|
|
|
|
RefCountedPtr<HandshakingState> handshaking_state_ref; |
|
|
|
|
listener_ = std::move(listener); |
|
|
|
|
{ |
|
|
|
|
MutexLock lock(&mu_); |
|
|
|
|
if (shutdown_) return; |
|
|
|
|
ReleasableMutexLock lock(&mu_); |
|
|
|
|
if (shutdown_) { |
|
|
|
|
lock.Release(); |
|
|
|
|
// If the Connection is already shutdown at this point, it implies the
|
|
|
|
|
// owning Chttp2ServerListener and all associated ActiveConnections have
|
|
|
|
|
// been orphaned. The generated endpoints need to be shutdown here to
|
|
|
|
|
// ensure the tcp connections are closed appropriately.
|
|
|
|
|
grpc_endpoint_shutdown(endpoint, absl::OkStatus()); |
|
|
|
|
grpc_endpoint_destroy(endpoint); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// Hold a ref to HandshakingState to allow starting the handshake outside
|
|
|
|
|
// the critical region.
|
|
|
|
|
handshaking_state_ref = handshaking_state_->Ref(); |
|
|
|
|