https://gitlab.synchro.net/main/sbbs/-/commit/a10960ca6dedc1a0a89226ae
Added Files:
exec/tests/ircd/sendq.js
Modified Files:
exec/load/ircd/core.js user.js
Log Message:
ircd: stop retrying the send queue of a closed connection forever
Queue_Send() re-arms itself on a 100 ms timer while a socket won't accept
more data. User_Quit() closed a local user's socket without purging its
send queue, and Socket.send() on a closed socket fails without throwing, so
the drain kept re-arming: every user who disconnected with output still
queued (typically a ping timeout on a client that had stopped reading) left
a 10 Hz timer running for the life of the process.
Those orphans accumulate. On cvs they reached about 70 timers (about 825
events per second) within a day, and after 5.5 days the callback engine was pinned at 100% of a core, could no longer answer PINGs in time, and every linked server dropped it.
Queue_Send() now purges and returns when the socket is no longer connected, which covers every path that closes a connection with output pending, and User_Quit() purges the local user's queues as the server quit path already
did.
exec/tests/ircd/sendq.js covers the 100 ms back-off on a stalled socket, the immediate continuation of a partial send, and dropping (not retrying)
output left on or queued to a closed socket.
Fixes #1289
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net