-
Notifications
You must be signed in to change notification settings - Fork 23
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
s3fs-nio trying to put back an object downloaded from the bucket #715
Comments
Thanks for reporting and for providing sample code to reproduce it! How large is the file? Also, just last night we released version If you could knock up a simple test case as well, that'll help figure out things quicker. |
size of the flle: 262149 bytes It happens with 1.0.1 as well. it has to do with a temporary file in S3SeekableByteChannel:
|
Hey @stefanofornari, Thanks for reporting this. Are you using S3 or StoreJ ? |
Hey, I am using StorJ, which I think uses MinIO |
I'm not entirely convinced this is a bug in s3fs-nio, because we have a test case that covers this exact behavior: s3fs-nio/src/test/java/org/carlspring/cloud/storage/s3fs/FilesIT.java Lines 762 to 847 in 1f33c9d
And it's working fine in S3. Maybe it's something specific to StoreJ? If you could create a reproducible test case with S3 that would be helpful. |
Hi Steve, PS: generally speaking, if you want s3fs-nio to be used with any S3 compliant service, even specific behaviour of a service should be managed by the library itself (but as I mentioned, StorJ uses MinIO). Additionally, as I pointed out in #715 (comment), this behaviour is due to library code; StorJ may trigger a corner case, but I would not be so quick in claiming it is not a bug. |
Maybe you've missed this part of the test:
In essence the test simulates creating a file at s3, checks if the upstream file contains the expected bytes and then replaces it a few times. We aim to be AWS S3 compliant. However this does not mean "any-cloud-solution-claiming-to-be-s3-complaint". MinIO also has it's own deviations in their implementation. For the better part it's compliant, but it's not 100% a 1 to 1 comparison. :) If you could try it out with S3 and maybe provide a test case in a repo that reproduces the problem -- that would be much appreciated. |
Ciao, @stefanofornari ! :)
We are in no rush to dismiss this issue. Optimally, we would like for Contributions are very welcome, as we are a small team. |
I think I did not make myself understood, sorry. All tests pass with StorJ. What I mean is that after a file is read with Files.readAllBytes(p); (and the download works well), the same blob is uploaded back to the bucket when the channel is closed. This upload is highly undesirable because it consumes bandwidth, it takes time and most importantly, it touches the file on the bucket. This is because, as explained in #715 (comment), when closing the channel sync() is called, which makes the file uploaded. This looks to me a bug in the library. To see it, you need to raise the level of the logs produced by the AWS SDK. |
Thanks for further elaborating! I don't have the time to look into this right now, but it does sound like it needs to be checked out. |
Would you be interested further investigating it and attempting to fix it? |
Bug Description
s3fs-nio trying to put back an object downloaded from the bucket as per stack trace:
Steps To Reproduce
Expected Behavior
The object is downloaded without sync back its content
Environment
s3fs-nio
version: 1.0.0The text was updated successfully, but these errors were encountered: