fix(wecom): add CLOSING state to _wait_for_handshake auth guard (#64703) - #64727
Closed
xxiaoxiong wants to merge 1 commit into
Closed
xxiaoxiong wants to merge 1 commit into
xxiaoxiong wants to merge 1 commit into
Conversation
…Research#64703) _wait_for_handshake() had the same gap that NousResearch#28311 fixed in _read_events(): WSMsgType.CLOSING was not handled, causing permanent reconnect failure when the server sent a CLOSING frame during the authentication handshake. The websocket closed permanently (all retry backoffs fail silently) and the only recovery was a manual pod/agent restart. After a mass gateway restart, 9/14 production WeCom agents lost connectivity. Add WSMsgType.CLOSING to the terminal-state set in _wait_for_handshake(), matching the existing set in _read_events() (which already includes it).
Duplicate of #64716 — identical one-line fix (adds |
Author
|
Closing as duplicate of #64716 (same CLOSING state fix, submitted first). Thanks @alt-glitch for the triage note — good catch. |
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
Fixes #64703.
_wait_for_handshake()inplugins/platforms/wecom/adapter.pydid not handleaiohttp.WSMsgType.CLOSING, causing permanent reconnect failure when the server sent a closing frame during the authentication handshake.Root cause
When #28311 fixed
_read_events()to handleWSMsgType.CLOSING(issue #28293),_wait_for_handshake()was missed. Both functions receive WebSocket messages and need to handle all terminal states, but_wait_for_handshake()was missingCLOSING:Before:
{WSMsgType.CLOSED, WSMsgType.CLOSE, WSMsgType.ERROR}After:
{WSMsgType.CLOSED, WSMsgType.CLOSE, WSMsgType.ERROR, WSMsgType.CLOSING}The
_read_events()set already includesCLOSING(since #28311).Impact
All reconnection attempts fail silently (backoff retries all hit the same hang), requiring a manual pod/agent restart to recover. In production: 9/14 WeCom agents permanently lost connectivity after a cluster restart.
Testing
One-character change (constant added to a set). Matches the identical set in
_read_events()(line 373).