Remove redundant stream closure check in QUIC connection close.

QuicStream::OnConnectionClose() will close the stream's write and read side.
QuicSession::CloseStream() does the exact same thing. Thus it's unnecessary.

Protected by gfe2_reloadable_flag_quic_do_not_close_stream_again_on_connection_close

PiperOrigin-RevId: 319096629
Change-Id: I6553276b2df934d944bcce8f9683fadc3201790d
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index a202c8e..9f4de44 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -397,10 +397,15 @@
   for (const auto& it : non_static_streams) {
     QuicStreamId id = it.first;
     it.second->OnConnectionClosed(frame.quic_error_code, source);
+    QUIC_RELOADABLE_FLAG_COUNT(
+        quic_do_not_close_stream_again_on_connection_close);
     if (stream_map_.find(id) != stream_map_.end()) {
       QUIC_BUG << ENDPOINT << "Stream " << id
                << " failed to close under OnConnectionClosed";
-      CloseStream(id);
+      if (!GetQuicReloadableFlag(
+              quic_do_not_close_stream_again_on_connection_close)) {
+        CloseStream(id);
+      }
     }
   }
 
diff --git a/quic/core/quic_session.h b/quic/core/quic_session.h
index 92c4082..f6f7bb6 100644
--- a/quic/core/quic_session.h
+++ b/quic/core/quic_session.h
@@ -229,7 +229,7 @@
 
   // Close stream |stream_id|. Whether sending RST_STREAM (and STOP_SENDING)
   // depends on the sending and receiving states.
-  // TODO(fayang): Deprecate CloseStream, instead always use ResetStream to
+  // TODO(b/136274541): Deprecate CloseStream, instead always use ResetStream to
   // close a stream from session.
   virtual void CloseStream(QuicStreamId stream_id);