Log skipped checksum validation only when a checksum header is provided #3387
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.
Related Issue: #3382
Summary
There are cases such as when making ranged
GetObject
requests to S3 when theChecksumMode
will be set toENABLED
by default, but S3 doesn't send us a checksum header. If multiple ranged requests are made for a single object, botocore will flood logs with this a skipped checksum validation message. Ranged GetObject requests are common for customers using high-level S3 commands that use s3transfer under the hood.To prevent unwanted logging, we will only log the skipped checksum validation message when an actual checksum header is provided AND we determine we can't perform checksum validation due to an unsupported algorithm.
Example
Output without PR:
Output with PR:
x-amz-checksum-<algo_name>
) exists in the response for us to validate.