From 003d2031b59c9b6e1927e24078649d7d396ea02a Mon Sep 17 00:00:00 2001 From: Vladislav Date: Fri, 18 Aug 2023 15:39:34 +0300 Subject: [PATCH] fix: fix batching during dispatch mode changes (#1713) Signed-off-by: Vladislav Oleshko --- src/facade/dragonfly_connection.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/facade/dragonfly_connection.cc b/src/facade/dragonfly_connection.cc index 77d5a6133..4b72a88eb 100644 --- a/src/facade/dragonfly_connection.cc +++ b/src/facade/dragonfly_connection.cc @@ -798,8 +798,10 @@ void Connection::DispatchFiber(util::FiberSocketBase* peer) { dispatch_q_.pop_front(); } - if (dispatch_q_.empty()) + if (dispatch_q_.empty()) { builder->FlushBatch(); + builder->SetBatchMode(false); // in case the next dispatch is sync + } } else { MessageHandle msg = move(dispatch_q_.front()); dispatch_q_.pop_front();