serve in internal/ircserver/conn.go sets a read deadline of readTimeout, five minutes, before every line it reads. Nothing sent to the client moves it, and the server never sends a PING: pingInterval and pongDeadline are declared in the same file and used nowhere. A registered client that sends no command for five minutes, however much it receives, has its socket closed; cleanup then runs BroadcastQuit, so the session is deleted, the nick released and the channels parted. Seen on eceb5f2: a registered connection that stayed quiet was closed by the server after 300 seconds, with no PING before it.
IRC clients expect the server to PING them and answer it. Many also send a PING of their own at intervals and survive; the rest are dropped every five minutes. README.md says a client on the IRC listener is removed after SESSION_IDLE_TIMEOUT (30 days by default) without a command, and its IRC listener section says nothing about a five-minute limit.
Fix: use the two constants as intended. After pingInterval with nothing read, send PING :<server> and close only when no line arrives within pongDeadline; any line read resets the clock. README.md IRC listener section gets one sentence on the PING and the deadline.
Definition of done
A registered connection that sends nothing receives a PING after pingInterval and stays open as long as it answers; one that does not answer within pongDeadline is closed.
Tests in internal/ircserver with short values for both.
README.md says so.
One reviewed PR against next.
Model: fable-5-1
`serve` in `internal/ircserver/conn.go` sets a read deadline of `readTimeout`, five minutes, before every line it reads. Nothing sent to the client moves it, and the server never sends a PING: `pingInterval` and `pongDeadline` are declared in the same file and used nowhere. A registered client that sends no command for five minutes, however much it receives, has its socket closed; `cleanup` then runs `BroadcastQuit`, so the session is deleted, the nick released and the channels parted. Seen on `eceb5f2`: a registered connection that stayed quiet was closed by the server after 300 seconds, with no PING before it.
IRC clients expect the server to PING them and answer it. Many also send a PING of their own at intervals and survive; the rest are dropped every five minutes. `README.md` says a client on the IRC listener is removed after `SESSION_IDLE_TIMEOUT` (30 days by default) without a command, and its IRC listener section says nothing about a five-minute limit.
Fix: use the two constants as intended. After `pingInterval` with nothing read, send `PING :<server>` and close only when no line arrives within `pongDeadline`; any line read resets the clock. `README.md` IRC listener section gets one sentence on the PING and the deadline.
## Definition of done
1. A registered connection that sends nothing receives a PING after `pingInterval` and stays open as long as it answers; one that does not answer within `pongDeadline` is closed.
2. Tests in `internal/ircserver` with short values for both.
3. `README.md` says so.
4. One reviewed PR against `next`.
Model: fable-5-1
clawbot
self-assigned this 2026-10-20 17:14:51 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
serveininternal/ircserver/conn.gosets a read deadline ofreadTimeout, five minutes, before every line it reads. Nothing sent to the client moves it, and the server never sends a PING:pingIntervalandpongDeadlineare declared in the same file and used nowhere. A registered client that sends no command for five minutes, however much it receives, has its socket closed;cleanupthen runsBroadcastQuit, so the session is deleted, the nick released and the channels parted. Seen oneceb5f2: a registered connection that stayed quiet was closed by the server after 300 seconds, with no PING before it.IRC clients expect the server to PING them and answer it. Many also send a PING of their own at intervals and survive; the rest are dropped every five minutes.
README.mdsays a client on the IRC listener is removed afterSESSION_IDLE_TIMEOUT(30 days by default) without a command, and its IRC listener section says nothing about a five-minute limit.Fix: use the two constants as intended. After
pingIntervalwith nothing read, sendPING :<server>and close only when no line arrives withinpongDeadline; any line read resets the clock.README.mdIRC listener section gets one sentence on the PING and the deadline.Definition of done
pingIntervaland stays open as long as it answers; one that does not answer withinpongDeadlineis closed.internal/ircserverwith short values for both.README.mdsays so.next.Model: fable-5-1