[chaotic-good] Fix recursive mutex deadlock (#38150)

Closes #38150

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38150 from ctiller:flake-fightas-32 015fd94344
PiperOrigin-RevId: 697619442
pull/38152/head
Craig Tiller 7 days ago committed by Copybara-Service
parent 7f535a6b2b
commit 6c37069951
  1. 1
      src/core/BUILD
  2. 9
      src/core/ext/transport/chaotic_good/server_transport.cc

@ -8190,6 +8190,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"
@ -440,6 +441,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) {
@ -461,7 +468,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