You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ws: WebSocketServer.clients is undefined (should be a Set) — heartbeat loops kill the process #9325
WebSocketServer.clients is undefined under Perry, where node has a Set. Any for…of over it throws TypeError: is not iterable, and because
the idiomatic place to iterate it is a heartbeat setInterval, the throw lands
in a timer callback where application code cannot catch it — the process exits
and, under systemd, restart-loops with no traffic at all.
Perry 0.5.1519 from source plus the fixes in #9314 and #9319. ws 8.x,
Linux x86_64.
Our API dies every few seconds on this, with no requests involved. It took
a gdb backtrace to find, because the JS-level message is only TypeError: is not iterable at <anonymous> even with --debug-symbols:
Uncatchable. It throws inside a timer callback in library-idiomatic
code, so no try/catch in application code prevents the exit.
No traffic needed. A service with zero connections still dies on the
heartbeat, so it looks like a startup or config problem rather than a
missing property.
wss.clients is how every ws server does connection tracking, heartbeats
and broadcast — it is not a corner of the API.
A clear TypeError on access would already be a large improvement over an undefined that only fails later, at a distance, inside a timer.
Activity