aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritrofimow <itrofimow@yandex-team.com>2024-01-23 16:39:33 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-01-24 15:02:09 +0300
commit70f4f505ed6e490e3ab66e2532a72377e642b30b (patch)
tree2d7e5db6f0759dba56402a4f22b7130bcd2c0125
parent4b4ac0bca2d12bc3d03d6d70bf62999268e12cf0 (diff)
downloadydb-70f4f505ed6e490e3ab66e2532a72377e642b30b.tar.gz
bug contrib/grpc: fix races between retries and cancellation
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
index 7ec4d5389c..c98ce6ee0b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
@@ -2604,7 +2604,9 @@ void RetryFilter::CallData::OnRetryTimerLocked(void* arg,
grpc_error_handle /*error*/) {
auto* calld = static_cast<CallData*>(arg);
calld->retry_timer_handle_.reset();
- calld->CreateCallAttempt(/*is_transparent_retry=*/false);
+ if (calld->cancelled_from_surface_.ok()) {
+ calld->CreateCallAttempt(/*is_transparent_retry=*/false);
+ }
GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnRetryTimer");
}