From 4c4a8da208f1eece4664b8d982b7d8fb01e4f882 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 16 Oct 2020 07:00:03 +0000 Subject: [PATCH] run when necessary Former-commit-id: d724e7226c690fdce0e6ee6cbf8afdb9481f51c5 --- src/networking.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/networking.cpp b/src/networking.cpp index f5698282b..9c4266df4 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -1915,8 +1915,10 @@ void ProcessPendingAsyncWrites() if (c->fPendingAsyncWriteHandler.compare_exchange_strong(expected, true)) { bool fResult = c->postFunction([](client *c) { c->fPendingAsyncWriteHandler = false; - clientInstallWriteHandler(c); - handleClientsWithPendingWrites(c->iel, g_pserver->aof_state); + if (c->bufpos || listLength(c->reply) || (c->flags & CLIENT_PENDING_WRITE)) { + clientInstallWriteHandler(c); + handleClientsWithPendingWrites(c->iel, g_pserver->aof_state); + } }, false); if (!fResult)