aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed_server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/embed_server.c b/embed_server.c
index f74bdad..5420145 100644
--- a/embed_server.c
+++ b/embed_server.c
@@ -884,7 +884,10 @@ static int timeout_cb(aeEventLoop *loop, long long id, void *clientData) {
client *c = s->clients;
while (c) {
client *next = c->next;
- if (!c->cancelled &&
+ /* refcount > 1 means a request from this client is queued or being
+ * processed by the worker; long batch queues (e.g. 4B long-document
+ * batches) must not be reaped as idle. */
+ if (!c->cancelled && c->refcount <= 1 &&
now - c->last_active_ms > PPLX_HTTP_CLIENT_TIMEOUT_MS)
close_client(c);
c = next;