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

Mountpoint crashes on reading 1 byte file #218

Closed
sauraank opened this issue Apr 24, 2023 · 2 comments
Closed

Mountpoint crashes on reading 1 byte file #218

sauraank opened this issue Apr 24, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sauraank
Copy link
Contributor

Mountpoint for Amazon S3 version

mountpoint-s3 0.2.0-70b2b68

AWS Region

eu-west-1

Describe the running environment

Running in EC2 on Amazon Linux 2 using instance profile credentials against an S3 bucket in the same account.
Also same happened on on my Mac using instance profile credentials against an S3 bucket.

What happened?

Mountpoint is constantly crashing when trying to read a 1 byte file. Tried it on several such objects. When they are wriiten to a file using getObject s3api CLI command, output the following result -
.% (where % is highlighted).
I am attaching the trace logs. Prefetcher is able to find the correct range and also finishing the rpefetching task. But it stops working after that.

Relevant log output

2023-04-21T16:40:51.019337Z TRACE getattr{req=5 ino=5}: mountpoint_s3::fs: fs:getattr with ino 5
2023-04-21T16:40:51.019471Z TRACE open{req=2 ino=5}: mountpoint_s3::fs: fs:open with ino 5 flags 0
2023-04-21T16:40:51.019742Z TRACE read{req=6 ino=5 fh=1 offset=0 size=1}: mountpoint_s3::fs: fs:read with ino 5 fh 1 offset 0 size 1
2023-04-21T16:40:51.019770Z TRACE read{req=6 ino=5 fh=1 offset=0 size=1}: mountpoint_s3::prefetch: read offset=0 length=1 next_seq_offset=0
2023-04-21T16:40:51.019789Z TRACE read{req=6 ino=5 fh=1 offset=0 size=1}: mountpoint_s3::prefetch: to_read=1
2023-04-21T16:40:51.019812Z TRACE read{req=6 ino=5 fh=1 offset=0 size=1}: mountpoint_s3::prefetch: spawning request range=0..1 size=1
2023-04-21T16:40:51.020002Z DEBUG read{req=6 ino=5 fh=1 offset=0 size=1}:prefetch{range=0..1}:get_object{id=21}: mountpoint_s3_client::s3_crt_client::get_object: new request bucket="plutotestankit" key="test/test_sdk_create_object/14899866888963238197/hello" range=Some(0..1) if_match=Some(ETag { etag: "\"5058f1af8388633f609cadb75a75dc9d\"" }) size=Some(1)
2023-04-21T16:40:51.250506Z DEBUG read{req=6 ino=5 fh=1 offset=0 size=1}:prefetch{range=0..1}:get_object{id=21}: mountpoint_s3_client::s3_crt_client: request finished request_id="GQNFMC3TRQWP8DJS" duration_us=230374
2023-04-21T16:40:51.250735Z TRACE read{req=6 ino=5 fh=1 offset=0 size=1}:prefetch{range=0..1}: mountpoint_s3::prefetch: finished



(It stops after this and crashes)
@sauraank sauraank added the bug Something isn't working label Apr 24, 2023
@passaro
Copy link
Contributor

passaro commented Apr 24, 2023

I suspect this is related to this recent issue in CRT: awslabs/aws-c-s3#272

@passaro passaro linked a pull request Apr 28, 2023 that will close this issue
jamesbornholt added a commit to jamesbornholt/mountpoint-s3 that referenced this issue Apr 28, 2023
This was helpful for debugging awslabs#218 and awslabs#226.

Signed-off-by: James Bornholt <bornholt@amazon.com>
jamesbornholt added a commit that referenced this issue Apr 28, 2023
This was helpful for debugging #218 and #226.

Signed-off-by: James Bornholt <bornholt@amazon.com>
jamesbornholt added a commit to jamesbornholt/mountpoint-s3 that referenced this issue May 1, 2023
This picks up the fix for awslabs#218.

Signed-off-by: James Bornholt <bornholt@amazon.com>
jamesbornholt added a commit that referenced this issue May 2, 2023
This picks up the fix for #218.

Signed-off-by: James Bornholt <bornholt@amazon.com>
passaro added a commit that referenced this issue May 4, 2023
Improve PartQueue to report an error (rather than blocking indeterminately) when trying to read beyond the body returned by the GetObject request. 

The previous behavior, compounded with a bug in the CRT (now fixed: #228) where GetObject unexpectedly returned an empty body, manifested in #218.
---------

Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
@passaro
Copy link
Contributor

passaro commented May 5, 2023

Issue fixed since merging #228.
Also added regression tests (#231) and improved error handling (#233).

@passaro passaro closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants