matrix-org / matrix-org/matrix-python-sdk
TCP timeout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 266
- Forks
- 118
- PR merge metrics
- No merged PRs in 30d
Description
Right now, the only timeout in the sdk is the server-side sync timeout. No client-side timeout is specified. This means that, under some network conditions, requests may hang indefinitely.
In particular, this makes a thread running client.listen_forever freeze for me once every few days on a VPS or sometimes when moving between wifi networks on a laptop (makes using the sdk for a long-running chatbot kinda annoying).
Passing a timeout into requests.request() seems to fix it, throwing an exception as desired.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at client.listen_forever and trace the request path to requests.request(), which the issue identifies as the place where a timeout can be passed. Determine how the client-side timeout should apply to long-running requests, then verify that stalled network requests no longer hang indefinitely and instead raise an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100