[flake] Fix recursive mutex issue in legacy chaotic good (#38156)

Mirrors #38150

Closes #38156

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38156 from ctiller:legacy-flake 91c4547106
PiperOrigin-RevId: 698391699
pull/38157/merge
Craig Tiller 5 days ago committed by Copybara-Service
parent d61d88d130
commit 4eb73bc81e
  1. 1
      src/core/BUILD
  2. 9
      src/core/ext/transport/chaotic_good_legacy/server_transport.cc

@ -8332,6 +8332,7 @@ grpc_cc_library(
"absl/random:bit_gen_ref",
"absl/status",
"absl/status:statusor",
"absl/cleanup",
"absl/types:optional",
"absl/types:variant",
],

@ -23,6 +23,7 @@
#include <string>
#include <tuple>
#include "absl/cleanup/cleanup.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/random/bit_gen_ref.h"
@ -488,6 +489,12 @@ absl::Status ChaoticGoodServerTransport::NewStream(
void ChaoticGoodServerTransport::PerformOp(grpc_transport_op* op) {
RefCountedPtr<Party> cancelled_party;
bool close_outgoing_frames = false;
auto cleanup = absl::MakeCleanup([&close_outgoing_frames, this]() {
if (close_outgoing_frames) {
outgoing_frames_.MarkClosed();
}
});
MutexLock lock(&mu_);
bool did_stuff = false;
if (op->start_connectivity_watch != nullptr) {
@ -509,7 +516,7 @@ void ChaoticGoodServerTransport::PerformOp(grpc_transport_op* op) {
}
if (!op->goaway_error.ok() || !op->disconnect_with_error.ok()) {
cancelled_party = std::move(party_);
outgoing_frames_.MarkClosed();
close_outgoing_frames = true;
state_tracker_.SetState(GRPC_CHANNEL_SHUTDOWN,
absl::UnavailableError("transport closed"),
"transport closed");

Loading…
Cancel
Save