add `timeout` when sending requests
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start in appcenter/derived_client.py at the session.get call referenced by the issue, then inspect how callers in appcenter/versions.py reach it. Compare the reported timeout=10 behavior with the current request path and decide how the timeout should be supplied. Done means requests no longer wait indefinitely and the chosen timeout behavior is covered by the project's available checks.
Written by the indexing model from the issue text.
Description
I wrote a scripts to pull version info every 30 seconds and when getting all versions by :
https://github.com/microsoft/appcenter-rest-python/blob/016008a64fbafbdc79dafd14a3ad7e41c4bedf6d/appcenter/versions.py#L113
I encounter a problem that the process seems stuck sometime and the last log i got is always:
[2023-11-02 04:35:03,968][INFO][appcenter.versions] Getting versions of app: [******]
[2023-11-02 04:35:03,968][DEBUG][appcenter.versions] Generated URL: https://api.appcenter.ms/v0.1/apps/[******]/[******]
[2023-11-02 04:35:03,968][DEBUG][urllib3.connectionpool] Starting new HTTPS connection (8): api.appcenter.ms:443
[2023-11-02 04:35:28,896][DEBUG][urllib3.connectionpool] https://api.appcenter.ms:443 "GET /v0.1/apps/[******]/[******]/releases?published_only=false&scope=tester HTTP/1.1" 200 990783
After investigation i confirm that it blames to the missing timeout setting when:
https://github.com/microsoft/appcenter-rest-python/blob/016008a64fbafbdc79dafd14a3ad7e41c4bedf6d/appcenter/derived_client.py#L187
and after changing to
response = self.session.get(url, timeout=10)
things seems normal and i will get TimeoutError as expected.
So could we add timeout argument? I am not sure should we set a default value or additionally expose it to the function that calls it.
- Dominant language
- Python
- Stars
- 25
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from microsoft/appcenter-rest-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
microsoft/appcenter-rest-python#25 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in microsoft/appcenter-rest-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100