Skip to content

[SPT-1644] Log WebSocket server errors instead of dropping them - #1039

Merged
justinpolygon merged 3 commits into
masterfrom
justin/spt-1644
Oct 16, 2026
Merged

justinpolygon merged 3 commits into
masterfrom
justin/spt-1644

Conversation

@justinpolygon

@justinpolygon justinpolygon commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

The server's status messages on the WebSocket connection were logged at DEBUG and then dropped, so problems were silent: rejected subscriptions (e.g. "Subscription limit reached for feed"), and the reason for a disconnect (max_connections, slow_consumer, force_disconnect, etc.), which the server sends right before closing. Any status other than connected, auth_success or success is now logged at WARNING on the WebSocketClient logger, one line per burst:

WebSocketClient WARNING: server error: Subscription limit reached for feed. ... (x1000)
WebSocketClient WARNING: server max_connections: Maximum number of websocket connections exceeded. ...

No other behavior changes. Tests are included. SPT-1644

@justinpolygon justinpolygon changed the title [SPT-1644] Pace WebSocket subscriptions and surface rejected channels [SPT-1644] Log WebSocket server errors instead of dropping them Oct 15, 2026
@justinpolygon
justinpolygon marked this pull request as ready for review October 16, 2026 19:27
Comment thread massive/websocket/__init__.py Outdated
Server status messages were logged at DEBUG and then dropped by parse(),
so errors such as "Subscription limit reached for feed" never reached
the user and rejected subscriptions failed silently.

Log status errors at WARNING. The server can send one error per
channel, so identical errors are counted and logged once a second (and
on close), e.g. "server error: Subscription limit reached for feed.
... (x1000)". No other behavior changes.
The server also sends statuses like max_connections,
max_connections_per_minute, auth_timeout, slow_consumer and
force_disconnect, usually right before closing the connection. These
were dropped too, so a disconnect looked like the stream just ending.

Log any status other than connected/auth_success/success as a warning,
including the replies to connecting and authenticating, and flush them
when the connection closes.
@justinpolygon
justinpolygon merged commit 6076ac8 into master Oct 16, 2026
7 checks passed
@justinpolygon
justinpolygon deleted the justin/spt-1644 branch October 16, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants