diff --git a/third-party/thrift/src/thrift/lib/cpp2/async/ResponseChannel.h b/third-party/thrift/src/thrift/lib/cpp2/async/ResponseChannel.h index 9f5d4ff5c1c699..e0d6235600b9ee 100644 --- a/third-party/thrift/src/thrift/lib/cpp2/async/ResponseChannel.h +++ b/third-party/thrift/src/thrift/lib/cpp2/async/ResponseChannel.h @@ -158,6 +158,12 @@ class ResponseChannelRequest { virtual ~ResponseChannelRequest() = default; + // Get queue timeout for this request. So any owner who wants to enqueue this + // request before processing can schedule timeout. + virtual std::chrono::milliseconds getQueueTimeoutMs() const { + return std::chrono::milliseconds(0); + } + bool getShouldStartProcessing() { if (!tryStartProcessing()) { return false; diff --git a/third-party/thrift/src/thrift/lib/cpp2/transport/core/ThriftRequest.h b/third-party/thrift/src/thrift/lib/cpp2/transport/core/ThriftRequest.h index b46d94f678edb4..8759120c42bed3 100644 --- a/third-party/thrift/src/thrift/lib/cpp2/transport/core/ThriftRequest.h +++ b/third-party/thrift/src/thrift/lib/cpp2/transport/core/ThriftRequest.h @@ -398,6 +398,10 @@ class ThriftRequestCore : public ResponseChannelRequest { } } + std::chrono::milliseconds getQueueTimeoutMs() const final { + return queueTimeout_.value; + } + ResponseRpcMetadata makeResponseRpcMetadata( transport::THeader::StringToStringMap&& writeHeaders, std::optional proxiedPayloadMetadata,