You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a connection attempt fails and the socket is being torn down before the next retry, any failure to close the half-open socket is discarded with no logging. This can hide resource leaks (unclosed sockets/file descriptors across retries) and makes it impossible to diagnose why a retry loop is behaving unexpectedly, since the only visible error becomes last_error from the connect failure, not the close failure.
Suggested Fix
Log the close failure at debug/warning level (consistent with how close() elsewhere in this file now handles cleanup errors, e.g. via logging.warning) instead of silently discarding it.
Closing as duplicate of #1106. Same underlying finding — the except Exception: pass wrapping ws.close() during connect-retry teardown in _ensure_connected in sdks/python/pmxt/ws_client.py (line numbers drifted from 132 to 159-162 due to unrelated config changes, but it's the same catch block). Note there's already an open PR (#1127) against #1106 for this fix — @nightcityblade you may want to check that first to avoid duplicate work.
Activity
nightcityblade commentedon Aug 17, 2026
Hi, I'd like to work on this. I'll submit a focused fix with a regression test shortly.
realfishsam commentedon Aug 18, 2026
Closing as duplicate of #1106. Same underlying finding — the
except Exception: passwrappingws.close()during connect-retry teardown in_ensure_connectedin sdks/python/pmxt/ws_client.py (line numbers drifted from 132 to 159-162 due to unrelated config changes, but it's the same catch block). Note there's already an open PR (#1127) against #1106 for this fix — @nightcityblade you may want to check that first to avoid duplicate work.Generated by Claude Code
except Exception: passduring WebSocket close #1106