Skip to content
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

Simplify get_object by waiting for response headers #1171

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

passaro
Copy link
Contributor

@passaro passaro commented Nov 27, 2024

S3CrtClient::get_object was originally implemented so that it would complete immediately and return a GetObjectRequest implementation (extending Stream) to retrieve body parts. Any error from the S3 request would be returned through the stream.
We recently added additional methods (get_object_metadata in #1065 and get_object_checksum in #1123) to the response that rely on the headers returned by the (first) GetObject request. The new methods required an async signature and a complicated implementation in order to account for failures and they still do not correctly report accurate error information in some cases.
With this change, we modify get_object to await for response headers before returning either an error or a GetObjectResponse (note the name change) implementation. The ergonomics of get_object are improved:

  • awaiting the initial call can already return some errors (e.g. bucket/key not found),
  • get_object_checksum and get_object_metadata are now sync functions.

Does this change impact existing behavior?

Yes, get_object behavior is different, get_object_checksum and get_object_metadata signatures have changed, and GetObjectRequest was renamed to GetObjectResponse.

Does this change need a changelog entry?

Yes, it requires a breaking change entry for mountpoint-s3-client.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:56 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:56 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 10:56 — with GitHub Actions Inactive
passaro added a commit to passaro/mountpoint-s3 that referenced this pull request Nov 27, 2024
Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:04 — with GitHub Actions Inactive
@passaro passaro marked this pull request as ready for review November 27, 2024 11:05
@passaro passaro temporarily deployed to PR integration tests November 27, 2024 11:28 — with GitHub Actions Inactive
passaro added a commit to passaro/mountpoint-s3 that referenced this pull request Nov 29, 2024
Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro temporarily deployed to PR integration tests November 29, 2024 08:40 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests November 29, 2024 08:40 — with GitHub Actions Inactive
Signed-off-by: Alessandro Passaro <[email protected]>
Signed-off-by: Alessandro Passaro <[email protected]>
Signed-off-by: Alessandro Passaro <[email protected]>
Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro added this pull request to the merge queue Dec 5, 2024
Merged via the queue into awslabs:main with commit 3c7fb3f Dec 5, 2024
26 checks passed
@passaro passaro deleted the async-get-object branch December 5, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance PRs to run benchmarks on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants