fix(qqbot): prevent reconnect stall after closed websocket - #32885
Closed
qixuancao wants to merge 1 commit into
Closed
fix(qqbot): prevent reconnect stall after closed websocket#32885qixuancao wants to merge 1 commit into
qixuancao wants to merge 1 commit into
Conversation
After a WebSocket close (e.g. code=4009 session timeout), if _get_gateway_url() fails during reconnect, the stale self._ws was left present-but-closed. _read_events() returned silently instead of raising, causing _listen_loop() to reset backoff and spin forever. - Raise RuntimeError from _read_events() when self._ws is closed. - Clear stale closed websocket in _reconnect() on failure. - Add regression tests verifying backoff progression is preserved. Refs: qqbot reconnect stall bug
Collaborator
|
Competing fix for #17703 (QQBot stops reconnecting after closed websocket). Multiple open PRs address the same root cause: #17704, #20994, #27821, #29057, #30431, #31333. This PR also clears stale ws on reconnect failure (similar to #20994's approach). Additionally references #31101 and #31771 (same symptoms, 100% CPU busy-loop). |
Contributor
|
Thanks for the focused QQBot investigation and regression coverage. Automated hermes-sweeper review found this behavior already implemented on current
The member discussion linking the competing reconnect fixes was useful; the current merged guard provides the PR's requested no-stall behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_read_events()raise when a present websocket is already closed instead of silently returningTesting
Fixes #31101
Related: #17703