Skip to content

libstore: curl retry: reset content-encoding and don't use string after move (backport #12603) - #13027

Merged
Mic92 merged 1 commit into
2.28-maintenancefrom
mergify/bp/2.28-maintenance/pr-12603
Apr 15, 2025
Merged

Mic92 merged 1 commit into
2.28-maintenancefrom
mergify/bp/2.28-maintenance/pr-12603

Conversation

@mergify

@mergify mergify Bot commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

Motivation

While analyzing #12419 I discovered that in case of a HTTP error 429 the retry behavior is problematic. The same TransferItem is issued again. decompressionSink is not reinitialized, so that it might be used after finish() is called. Furthermore it's possible that errorSink is used again after errorSink->s is moved.

Additionally the Content-Encoding header of the HTTP 429 response and of the HTTP 200 response might be different. In this case the decompression of the HTTP 200 response body might fail.

Context

Might fix #12419, although I wasn't able to provoke any HTTP error 429 on Github. Github seems to prefer gzip encoding and the response body of the error response shown in the issue seems to be short, but not empty. Thus it seems to be unlikely that this error response contained the header Content-Encoding: gzip, while the reply with the content probably had it set. More details about the responses would be helpful.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.


This is an automatic backport of pull request #12603 done by [Mergify](https://mergify.com).

@mergify
mergify Bot requested a review from Ericson2314 as a code owner April 15, 2025 11:22
@mergify mergify Bot added automatic backport This PR is a backport produced by automation (does not trigger backporting) merge-queue labels Apr 15, 2025
@mergify

mergify Bot commented Apr 15, 2025

Copy link
Copy Markdown
Contributor Author

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #13027 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: Required status check "tests on ubuntu" is in progress.).

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@Mic92
Mic92 enabled auto-merge April 15, 2025 11:59
@Mic92
Mic92 merged commit f233a99 into 2.28-maintenance Apr 15, 2025
@Mic92
Mic92 deleted the mergify/bp/2.28-maintenance/pr-12603 branch April 15, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automatic backport This PR is a backport produced by automation (does not trigger backporting) merge-queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants