diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 10:50:12 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | aab6459e1d0c3e9d61ace3601bf4d64a801fcccd (patch) | |
| tree | 056b247190db64e048e632bb02fb611caec10bb8 | |
| parent | 0cfb4eab76c2620f5fe381e82993ec531f0777ab (diff) | |
| download | ffwd-aab6459e1d0c3e9d61ace3601bf4d64a801fcccd.tar.gz ffwd-aab6459e1d0c3e9d61ace3601bf4d64a801fcccd.zip | |
server: do not idle-reap clients with requests in flight
| -rw-r--r-- | embed_server.c | 5 |
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; |
