Skip to content

fix(ws): bound endpoint discovery request timeout - #170

Open
dajiaohuang wants to merge 1 commit into
larksuite:v2_mainfrom
dajiaohuang:fix/169-ws-endpoint-timeout
Open

fix(ws): bound endpoint discovery request timeout#170
dajiaohuang wants to merge 1 commit into
larksuite:v2_mainfrom
dajiaohuang:fix/169-ws-endpoint-timeout

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Sep 4, 2026

Copy link
Copy Markdown

The WebSocket reconnect path performs endpoint discovery with requests.post and no timeout. A stalled connection can block _get_conn_url() indefinitely, preventing subsequent reconnect attempts.

Set a 10-second connect timeout and a 30-second read timeout. The existing exception handling in _try_connect() handles request timeouts and lets the reconnect loop continue.

Validation: python -m pytest lark_oapi/ws/tests/test_websockets_compat.py -q (5 passed) and git diff --check. The focused test verifies the timeout passed to Requests; no live Feishu or network black-hole test was run.

Fixes #169

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.

ws.Client reconnect loop can hang forever: requests.post in _get_conn_url() has no timeout

1 participant