Skip to content

Commit

Permalink
Move HHVM Thrift Server to ResourcePool API and Implement QueueTimeout
Browse files Browse the repository at this point in the history
Summary:
* Moved code from old API to new API, so resourcePool migration for this AsyncProcessor considered DONE.
* Expose QueueTimeout from ThriftRequest, so downstream AsyncProcessor can implement own QueueTimeout instead of relying on thrift internal.
* Implemented queue timeout for HHVM thrift server.

Reviewed By: tlj77

Differential Revision: D64840522

fbshipit-source-id: 397ccb19c26c2de01705f463f28ff62f853e2573
  • Loading branch information
Rashmi Makheja authored and facebook-github-bot committed Dec 24, 2024
1 parent 6378987 commit 5185cb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions thrift/lib/cpp2/async/ResponseChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions thrift/lib/cpp2/transport/core/ThriftRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> proxiedPayloadMetadata,
Expand Down

0 comments on commit 5185cb7

Please sign in to comment.