From 9b6c365c4467fe74c6c4cdd17d7dd138871fff08 Mon Sep 17 00:00:00 2001 From: Emanuele Altieri Date: Tue, 10 Dec 2024 15:24:53 -0800 Subject: [PATCH] Pin shadow requests to specific proxy threads Summary: Shadow requests are pinned to specific threads based on destination host when routed via `SRRoute` and `jump_threads=True`. This greatly reduces the number of connections to the shadow tier. Reviewed By: stuclar Differential Revision: D66558771 fbshipit-source-id: b501a126614732de52cf4d16ce004f6872348a14 --- mcrouter/routes/ShadowRoute-inl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mcrouter/routes/ShadowRoute-inl.h b/mcrouter/routes/ShadowRoute-inl.h index e9153be42..94d1c57b0 100644 --- a/mcrouter/routes/ShadowRoute-inl.h +++ b/mcrouter/routes/ShadowRoute-inl.h @@ -31,6 +31,8 @@ void ShadowRoute::dispatchShadowRequest( // we don't want to spool shadow requests fiber_local::clearAsynclogName(); fiber_local::addRequestClass(RequestClass::kShadow); + // pin shadow requests to specific threads based on destination + fiber_local::enableJumpThreads(); const auto shadowReply = shadow->route(*adjustedReq); if (postShadowReplyFn) { postShadowReplyFn(shadowReply);