tools: Previous response not closed before retry — connection pool can leak under sustained 429/5xx
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- networking
Research direction
Open src/entrabot/tools/rate_limit.py and inspect handle_async_request around lines 62-107, focusing on the retry loop and the prior httpx response. Confirm how responses are released before another request is issued. Done means each retry closes or consumes the previous response so sustained 429/5xx traffic does not retain connections in the pool.
Written by the indexing model from the issue text.
Description
File: src/entrabot/tools/rate_limit.py
Location: handle_async_request (L62-L107)
Category: leak
Priority: low
Description
On each retry the loop reassigns response without aclose() / aread() on the prior one. httpx returns the underlying connection to the pool only after the response is consumed or GC'd; under sustained 429 or 5xx traffic this can cause pool starvation.
Suggested fix
await response.aread() (or aclose()) immediately before issuing the retry request.
Filed automatically by a thorough code-review pass over src/entrabot/ on 2026-06-13. Internal review id: #58.
- Dominant language
- Python
- Stars
- 9
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
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.
More from microsoft/entrabot
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
All issues in microsoft/entrabot
Similar issues
-
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
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100