秋田预测市场 · Discord 审计

py-sdk 因消息数量限制出现 ConnectionTerminated 错误

2026-07-13 · Polymarket · 6 条相关讨论

xny 2026-07-12 22:28:25

can anyone help me with this exception, been getting this since ive moved to the new py-sdk Exception: <ConnectionTerminated error_code:0, last_stream_id:19999, additional_data:None>

can anyone help me with this exception, been getting this since ive moved to the new py-sdk Exception: <ConnectionTerminated error_code:0, last_stream_id:19999, additional_data:None>

xny 2026-07-12 22:28:41

not sure how to handle it

not sure how to handle it

elucidate 2026-07-12 22:29:54

the connection closes after 20k messages, just reconnect or reconnect earlier

the connection closes after 20k messages, just reconnect or reconnect earlier

xny 2026-07-12 22:32:59

could you elaborate, not sure what you mean by reconnect. im placing/cancelling orders quite frequently through the sdk

could you elaborate, not sure what you mean by reconnect. im placing/cancelling orders quite frequently through the sdk

elucidate 2026-07-12 22:40:49

new py-sdk uses HTTP 2 which reuses connection for requests, it caps at 20k messages (practically 10k client requests) then it will close the connection, the easy solution is just to try except and when you hit the exception, rebuild the client

new py-sdk uses HTTP 2 which reuses connection for requests, it caps at 20k messages (practically 10k client requests) then it will close the connection, the easy solution is just to try except and when you hit the exception, rebuild the client

xny 2026-07-12 22:46:31

ok thanks, I think I understand now. might just look to rebuild the client periodically before it hits the cap

ok thanks, I think I understand now. might just look to rebuild the client periodically before it hits the cap