Skip to content

Fix: Provide body on retry error, preserve socket #4228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fatal10110
Copy link
Contributor

@fatal10110 fatal10110 commented May 17, 2025

This relates to...

Trying to fix #4222

I didn't touch any ranged/partial content behaviour, as it is unexpected server response and I guess should really throw an error in this case.

Rationale

Currently retry-handler has two issues

  1. It destroys the socket on each retry
  2. We loose the body on retry failure

Changes

Added a flag to make the handler react to "retry" callback result, and apply relevan functionality, instead of throwing the error immediately

Bug Fixes

#4222

Breaking Changes and Deprecations

in old flow, throw moved from onResponseStart to onResponseEnd which should not affect anyone as callbacks are not propogated

Status

@fatal10110 fatal10110 force-pushed the fix_retry_handler branch 3 times, most recently from 230ec24 to c48ed92 Compare May 19, 2025 19:26
@fatal10110 fatal10110 force-pushed the fix_retry_handler branch from c48ed92 to 58e326b Compare May 19, 2025 19:47
@fatal10110 fatal10110 marked this pull request as ready for review May 19, 2025 19:57
@fatal10110 fatal10110 changed the title [WIP] Fix: Provide body on retry error, preserve socket Fix: Provide body on retry error, preserve socket May 20, 2025
@fatal10110
Copy link
Contributor Author

I do not think CI failure is somehow related to this PR

@fatal10110
Copy link
Contributor Author

@Uzlopak @mcollina Kind ping, is this PR missing someting ?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina requested review from metcoder95 and ronag May 28, 2025 15:47
Copy link
Member

@metcoder95 metcoder95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just smaller typos

fatal10110 and others added 2 commits May 30, 2025 19:37
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.

Retry handler destroys the socket on error status code
3 participants