-
Notifications
You must be signed in to change notification settings - Fork 1.1k
reading file twice (in PutObject) #711
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
Comments
The default ctor args for s3 turn the payload hashing off of you are using tls. Also, setting the content length field will prevent the seek operations to figure it out. By controlling both of these settings, the file will only be read once.
…Sent from my iPhone
On Oct 30, 2017, at 9:27 AM, crusader-mike ***@***.***> wrote:
Apparently AWS SDK needs to calculate some sort of signature before sending bytes over wire (in PutObject/etc) -- related stream gets read and then rewound to start and read again. Is there any way to avoid this double "read file from disk" besides using streambuf that keeps entire file in memory?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Huh... I am using https and reading file (in my own implementation of streambuf) only in |
After examining my (relatively recent) SDK sources I came to a conclusion that it is impossible to switch off "payload signing" without overriding request class methods -- all requests get payload signed if I dug in this a bit more and found that Amazon S3 (as of now) allows unsigned payloads, but you can configure your bucket to deny such requests. Is it a prelude to total ban on unsigned payloads service wide? In any case -- it would be very nice to have a switch in S3Client (or library-wide?) that would forcefully disable/enable payload signing (regardless of HTTP/HTTPS flag). Please :) Until then I believe I have only these options:
Sounds like option number 2 is the least of all evil right now. |
This is a bug. We need to fix it. |
Thank you. Would be nice to be able to skip payload signature in HTTP case too... |
A note about option N2 -- multipart upload is limited to 10'000 chunks. Which means for files bigger than 50GB chunk size will start growing and at some point they won't fit into memory (especially if you upload them in parallel). I.e. you'll have to limit memory buffer and you'll end up reading entire file twice. |
Hi, you can avoid reading file twice by skipping payload signature with the latest update(ver 1.3.1) now: auto s3Client = Aws::MakeShared<S3Client>(ALLOCATION_TAG, credentialsProvider, config, AWSAuthV4Signer::PayloadSigningPolicy::Never /*signPayloads*/, true /*useVirtualAddressing*/); in which Please consult this commit for more details: b9ccf4d I am closing this issue, if you encounter any further problem, please reopen it. |
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md) - [Commits](junit-team/junit4@r4.12...r4.13.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@singku @wps132230 I've discovered that with HTTP endpoint my source files/objects are still being read twice. Culprit is check for Can someone explain why SDK insists on calculating payload hash on non-HTTPS endpoints even if I explicitly asked it not to "sign body"? Is there an easy way to switch it off without substituting request signer object? |
Apparently AWS SDK needs to calculate some sort of signature before sending bytes over wire (in PutObject/etc) -- related stream gets read and then rewound to start and read again. Is there any way to avoid this double "read file from disk" besides using streambuf that keeps entire file in memory?
The text was updated successfully, but these errors were encountered: