Skip to content

fix: add explicit timeout to async aiohttp requests - #179

Merged
astrinh0 merged 6 commits into
fustom:mainfrom
dpmworld:fix/async-request-timeout
Nov 13, 2026
Merged

astrinh0 merged 6 commits into
fustom:mainfrom
dpmworld:fix/async-request-timeout

Conversation

@dpmworld

@dpmworld dpmworld commented May 6, 2026

Copy link
Copy Markdown
Contributor

The async request path created a new aiohttp.ClientSession() without specifying a timeout, which falls back to aiohttp's default of 5 minutes. The synchronous requests path uses a 30 second timeout, so a hung connection produced very different failure modes between the two code paths.

Pass an explicit ClientTimeout(total=30) to the session to align the async path with the sync path and to fail fast when the upstream service is unresponsive.

dpmworld and others added 3 commits May 6, 2026 10:27
The async request path created a new `aiohttp.ClientSession()` without
specifying a timeout, which falls back to aiohttp's default of 5
minutes. The synchronous `requests` path uses a 30 second timeout, so
a hung connection produced very different failure modes between the
two code paths.

Pass an explicit `ClientTimeout(total=30)` to the session to align the
async path with the sync path and to fail fast when the upstream
service is unresponsive.
Comment thread ariston/ariston_api.py Resolved
dpmworld and others added 2 commits November 13, 2026 10:08
Check the timeout passed to aiohttp.ClientSession so the explicit total timeout cannot be removed or changed unnoticed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dpmworld
dpmworld requested a review from astrinh0 November 13, 2026 10:59
@dpmworld

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Added the test in 264be7c: the existing async request test now asserts that every aiohttp.ClientSession is created with timeout=aiohttp.ClientTimeout(total=30). I verified it fails when the timeout is removed and passes with the fix. CI is green. Ready for another look.

@astrinh0
astrinh0 merged commit d2df20d into fustom:main Nov 13, 2026
5 checks passed
@dpmworld
dpmworld deleted the fix/async-request-timeout branch November 15, 2026 12:39
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.

2 participants