fix(qqbot): trigger fatal error + reconnect when max reconnect attempts reached#17814
Open
fengtianyu88 wants to merge 1 commit into
Open
fix(qqbot): trigger fatal error + reconnect when max reconnect attempts reached#17814fengtianyu88 wants to merge 1 commit into
fengtianyu88 wants to merge 1 commit into
Conversation
Collaborator
Collaborator
…ts reached in _listen_loop When the QQ adapter's _listen_loop() exhausts all reconnect attempts (MAX_RECONNECT_ATTEMPTS=100), it previously returned silently without notifying the gateway. This left the bot in a zombie state: the gateway believed the platform was connected (is_connected returned True) while the adapter was dead. Fix: use the same _set_fatal_error() + _notify_fatal_error() pattern that telegram.py uses (line 365-366). This triggers: 1. _handle_adapter_fatal_error() in the gateway run loop 2. Adapter removed from self.adapters 3. Platform added to _failed_platforms for background reconnection 4. _platform_reconnect_watcher() picks it up and retries with backoff Three paths are covered: - Rate limit (code 4008) exhausts retries - QQCloseError reconnect failures exceed limit - General WebSocket exception reconnect failures exceed limit
b525a9a to
cce3827
Compare
Contributor
Author
|
Agreed this is a duplicate in terms of the root cause fix. The key difference is the
The If the maintainer preference is |
This was referenced May 14, 2026
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
When the QQ adapters _listen_loop() exhausts all reconnect attempts (MAX_RECONNECT_ATTEMPTS=100), it previously returned silently without notifying the gateway. This left the bot in a zombie state: the gateway believed the platform was connected (is_connected returned True) while the adapter was dead.
Fix
Use the same _set_fatal_error() + _notify_fatal_error() pattern that telegram.py uses. This triggers:
Three paths are covered:
Root Cause
Analyzed 11 Reconnect failed events in errors.log: