From 2648d7f37f5b10a6b8501b1b0fb02ee1d5a28fac Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 10 Oct 2024 15:17:54 -0700 Subject: [PATCH] x --- src/core/ext/transport/chaotic_good/server_transport.cc | 4 ++++ src/core/ext/transport/chaotic_good/server_transport.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/core/ext/transport/chaotic_good/server_transport.cc b/src/core/ext/transport/chaotic_good/server_transport.cc index b166d79380f..b28f99cda92 100644 --- a/src/core/ext/transport/chaotic_good/server_transport.cc +++ b/src/core/ext/transport/chaotic_good/server_transport.cc @@ -397,6 +397,7 @@ void ChaoticGoodServerTransport::AbortWithError() { // Close all the available pipes. outgoing_frames_.MarkClosed(); ReleasableMutexLock lock(&mu_); + aborted_with_error_ = true; StreamMap stream_map = std::move(stream_map_); stream_map_.clear(); state_tracker_.SetState(GRPC_CHANNEL_SHUTDOWN, @@ -439,6 +440,9 @@ absl::Status ChaoticGoodServerTransport::NewStream( GRPC_TRACE_LOG(chaotic_good, INFO) << "CHAOTIC_GOOD " << this << " NewStream " << stream_id; MutexLock lock(&mu_); + if (aborted_with_error_) { + return absl::UnavailableError("Transport closed"); + } auto it = stream_map_.find(stream_id); if (it != stream_map_.end()) { return absl::InternalError("Stream already exists"); diff --git a/src/core/ext/transport/chaotic_good/server_transport.h b/src/core/ext/transport/chaotic_good/server_transport.h index 49fd5ae015f..9148e5dca8b 100644 --- a/src/core/ext/transport/chaotic_good/server_transport.h +++ b/src/core/ext/transport/chaotic_good/server_transport.h @@ -143,6 +143,7 @@ class ChaoticGoodServerTransport final : public ServerTransport { Mutex mu_; // Map of stream incoming server frames, key is stream_id. StreamMap stream_map_ ABSL_GUARDED_BY(mu_); + bool aborted_with_error_ ABSL_GUARDED_BY(mu_) = false; uint32_t last_seen_new_stream_id_ = 0; RefCountedPtr party_; ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(mu_){