[flakiness] Fix timeout flakiness in //test/core/end2end:cancel_after_invoke_test

Based on discussions with drfloob@

PiperOrigin-RevId: 596958525
pull/35481/head
Vignesh Babu 1 year ago committed by Craig Tiller
parent 0df505d9db
commit f5acbf79e2
  1. 13
      src/core/ext/transport/chttp2/server/chttp2_server.cc

@ -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();

Loading…
Cancel
Save