Skip to content

fix: Classify and retry failures while reading a streamed error body - #1020

Merged
vdusek merged 3 commits into
masterfrom
fix-streamed-error-body-read
Aug 18, 2026
Merged

fix: Classify and retry failures while reading a streamed error body#1020
vdusek merged 3 commits into
masterfrom
fix-streamed-error-body-read

Conversation

@vdusek

@vdusek vdusek commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Before raising ApifyApiError, _make_request buffers the response so a streamed error body reaches the exception. That read sat outside the try block that classifies an attempt, so a failure there escaped the retry policy entirely: a non-retryable failure was retried through the whole backoff, and the response was left open.

The read now goes through the same classification as a failed send — retried when it is a transient transport failure, surfaced immediately when it is not — and the response is closed before the exception propagates.

Split out of #1006 and re-targeted at master, so the retry fixes can ship in a patch release ahead of the pipeline refactor in #1011.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 18, 2026
@vdusek vdusek self-assigned this Aug 18, 2026
@github-actions github-actions Bot added this to the 147th sprint - Tooling team milestone Aug 18, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (334e131) to head (a810910).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1020      +/-   ##
==========================================
- Coverage   94.87%   94.87%   -0.01%     
==========================================
  Files          58       58              
  Lines        5367     5384      +17     
==========================================
+ Hits         5092     5108      +16     
- Misses        275      276       +1     
Flag Coverage Δ
integration 91.66% <81.81%> (-0.56%) ⬇️
unit 85.19% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek marked this pull request as ready for review August 18, 2026 13:48
@vdusek
vdusek requested a review from Pijukatel August 18, 2026 13:48
Comment thread src/apify_client/http_clients/_impit.py Outdated
@vdusek
vdusek merged commit 2760aa6 into master Aug 18, 2026
30 checks passed
@vdusek
vdusek deleted the fix-streamed-error-body-read branch August 18, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants