fix(wecom): add CLOSING state to _wait_for_handshake terminal handler - #64707
Closed
mydearzsy wants to merge 2 commits into
Closed
fix(wecom): add CLOSING state to _wait_for_handshake terminal handler#64707mydearzsy wants to merge 2 commits into
mydearzsy wants to merge 2 commits into
Conversation
_wait_for_handshake() was missing aiohttp.WSMsgType.CLOSING from its terminal state check, causing WeCom reconnection to fail permanently after mass restart when the server sends a CLOSING frame during the authentication handshake. This mirrors the identical fix already applied to _read_events() in NousResearch#28311 (for issue NousResearch#28293), which was overlooked in _wait_for_handshake(). Fixes: NousResearch#64703
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.
What
Adds
aiohttp.WSMsgType.CLOSINGto the terminal state check in_wait_for_handshake(), matching the identical fix already applied to_read_events()in #28311 (for issue #28293).Why
_wait_for_handshake()was missingWSMsgType.CLOSINGfrom its terminal state handler, causing WeCom reconnection to fail permanently with "closed during authentication" when the server sends a CLOSING frame during the authentication handshake.When #28311 fixed
_read_events()for issue #28293,_wait_for_handshake()was overlooked — both functions handle WebSocket messages and need to recognize all terminal states.Impact
In production with multiple WeCom agents: after a mass restart event, agents that receive a CLOSING frame during the reconnection handshake get stuck in a permanent failure loop — manual pod restart is required to recover.
Fix
One-line change in
plugins/platforms/wecom/adapter.py:Identical to the pattern already in
_read_events()(line ~370).Fixes: #64703