diff options
| author | Daniil Cherednik <[email protected]> | 2023-03-31 10:54:08 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2023-03-31 12:28:07 +0300 |
| commit | fc1cffcfa7f0497a1f97b384a24bcbf23362f3be (patch) | |
| tree | c15f7ab5b9e9b20fd0ef8fc07d598d28e8b32004 /library/cpp/grpc/server/grpc_request.h | |
| parent | 8a749596d40e91c896a1907afcd108d9221fbde1 (diff) | |
Ydb stable 23-1-1923.1.19
x-stable-origin-commit: c5d5a396e89d0a72e0267a55e93d8404d4fb54fe
Diffstat (limited to 'library/cpp/grpc/server/grpc_request.h')
| -rw-r--r-- | library/cpp/grpc/server/grpc_request.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h index c4b7e9c040e..4e869ef5f6f 100644 --- a/library/cpp/grpc/server/grpc_request.h +++ b/library/cpp/grpc/server/grpc_request.h @@ -113,6 +113,10 @@ public: return FinishPromise_.GetFuture(); } + bool IsClientLost() const override { + return ClientLost_.load(); + } + TString GetPeer() const override { return TString(this->Context.peer()); } @@ -496,6 +500,7 @@ private: void OnFinish(EQueueEventStatus evStatus) { if (this->Context.IsCancelled()) { + ClientLost_.store(true); FinishPromise_.SetValue(EFinishStatus::CANCEL); } else { FinishPromise_.SetValue(evStatus == EQueueEventStatus::OK ? EFinishStatus::OK : EFinishStatus::ERROR); @@ -556,6 +561,7 @@ private: NThreading::TPromise<EFinishStatus> FinishPromise_; bool SkipUpdateCountersOnError = false; IStreamAdaptor::TPtr StreamAdaptor_; + std::atomic<bool> ClientLost_ = false; }; template<typename TIn, typename TOut, typename TService, typename TInProtoPrinter=google::protobuf::TextFormat::Printer, typename TOutProtoPrinter=google::protobuf::TextFormat::Printer> |
