PXB-3498: [xbcloud] Fix HTTP request signing when retrying#1650
Open
imrivera wants to merge 1 commit intopercona:trunkfrom
Open
PXB-3498: [xbcloud] Fix HTTP request signing when retrying#1650imrivera wants to merge 1 commit intopercona:trunkfrom
imrivera wants to merge 1 commit intopercona:trunkfrom
Conversation
imrivera
commented
Apr 10, 2025
| delay, name.c_str(), count); | ||
| std::this_thread::sleep_for(std::chrono::milliseconds(delay)); | ||
| resp->reset_body(); | ||
| client->signer->sign_request(client->hostname(container), container, *req, |
Author
There was a problem hiding this comment.
This is the main problem. These parameters are correct for S3, but not for Azure (for Azure they should be container and name)
Contributor
|
Thank you for the contribution: I've created JIRA for this issue: https://perconadev.atlassian.net/browse/PXB-3498 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using
xbcloud, when there is a problem downloading a file and it's going to be retried, the new request should be signed again for S3 and Azure. But the parameters used were only valid for S3.That means that if you're downloading from Azure, once a file fails to download, the retry is going to miscalculate the authorization token, that would receive a
403 Unauthorizedand the whole downloading process stop.This PR fixes that problem. The approach is encapsulating the signing process and the related data in a
std::functionin theHttp_requestobject. This way, you just have to callreq->sign()to resign the request, you don't need to know what data it needs, etc.This bug was found in a production service. The fix was also tested in the same service with successful result.