the watchdog reloaded the page even while data was arriving
If for 16 seconds (keepalives_eq_max x watchdog_checktm x watchdog_timeout)
the keepalive counter does not move forward, the client declares the
connection dead and reloads the page, splash included.
But that counter only moves forward when the client manages to CONSUME the
incoming data. If the browser is busy - redrawing the list of a crowded room,
say - the data arrives regularly and sits there waiting to be parsed: the
counter stays put and the watchdog reloads a perfectly healthy connection,
throwing away the work done.
Now, before declaring it dead, it looks at whether there is still something
to consume: bytes received and not parsed yet, commands already extracted and
not executed yet, or slow actions in progress (st_loc < st_loc_new, which is
the client itself saying it is busy). In those cases the connection is alive
and it gets another round instead of a reload.
The timeout stays at 16 seconds: what changes is the criterion, not the
patience. A connection that really is gone receives nothing any more, so the
three indicators are at zero and the reload happens as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE