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

Do not fail the object fetch when object size is unknown #932

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

jianoaix
Copy link
Contributor

@jianoaix jianoaix commented Nov 25, 2024

Why are these changes needed?

If it fails to peek the object size, we just use a default size and continue to download the blob (instead of failing it).

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@jianoaix jianoaix requested a review from dmanc November 25, 2024 16:50
size, err := PeekObjectSize(ctx, s.s3Client, bucket, key)
if err != nil {
return nil, err
objectSize := 128 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was this number chosen? Also should make it a const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just give it a moderate number so it won't waste a lot, nor need to realloc the memory too many times.

@jianoaix jianoaix merged commit 2cbfaa4 into Layr-Labs:master Nov 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants