Skip to content

Commit 680cb92

Browse files
Michal Ostrowskifacebook-github-bot
authored andcommitted
ServiceRouter: IEQE Support Fixes.
Summary: In ordr to support IEQE using client interceptors to direct traffic to experimental vs control targets: 1. Make RPCOptions non-const to allow the interceptor to modify it. 2. getOperationMask in RpcOptions must return a reference - else operationMask_ref() in RoutingParamsResolver will return a reference to a stack value -> memory corruption. Reviewed By: tlj77, joshbollarmeta Differential Revision: D77077414 fbshipit-source-id: 3c26d61c1017e24494a73400c940d986f3cda20f
1 parent ca7697d commit 680cb92

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

third-party/thrift/src/thrift/lib/cpp2/async/ClientInterceptorBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ClientInterceptorBase {
5959
/**
6060
* RpcOptions that were applied to this request
6161
*/
62-
const RpcOptions* rpcOptions = nullptr;
62+
RpcOptions* rpcOptions = nullptr;
6363
};
6464
virtual void internal_onRequest(RequestInfo) = 0;
6565

third-party/thrift/src/thrift/lib/cpp2/async/RpcOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ RpcOptions& RpcOptions::setOperationMask(int32_t operationMask) {
164164
return *this;
165165
}
166166

167-
int32_t RpcOptions::getOperationMask() const {
167+
const int32_t& RpcOptions::getOperationMask() const {
168168
return operationMask_;
169169
}
170170

third-party/thrift/src/thrift/lib/cpp2/async/RpcOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class RpcOptions {
133133
const std::string& getShardId() const;
134134

135135
RpcOptions& setOperationMask(int32_t operationMask);
136-
int32_t getOperationMask() const;
136+
const int32_t& getOperationMask() const;
137137

138138
void setWriteHeader(std::string_view key, std::string value);
139139
const transport::THeader::StringToStringMap& getWriteHeaders() const;

0 commit comments

Comments
 (0)