From 59c81fb98af0b59441d92d00483dfecb7af45f1f Mon Sep 17 00:00:00 2001 From: adiholden Date: Sun, 17 Nov 2024 16:03:30 +0200 Subject: [PATCH] fix server: fix write to slowlog on squashing flow (#4138) Signed-off-by: adi_holden --- src/server/main_service.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/main_service.cc b/src/server/main_service.cc index 8787aa4c0..b6c361bab 100644 --- a/src/server/main_service.cc +++ b/src/server/main_service.cc @@ -1358,6 +1358,10 @@ bool Service::InvokeCmd(const CommandId* cid, CmdArgList tail_args, SinkReplyBui // TODO: we should probably discard more commands here, // not just the blocking ones const auto* conn = cntx->conn(); + if (cntx->conn_state.squashing_info) { + conn = cntx->conn_state.squashing_info->owner->conn(); + } + if (!(cid->opt_mask() & CO::BLOCKING) && conn != nullptr && // Use SafeTLocal() to avoid accessing the wrong thread local instance ServerState::SafeTLocal()->ShouldLogSlowCmd(invoke_time_usec)) {