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

fix: AmazonS3KeyValueAccess.isFile #23

Merged
merged 1 commit into from
Feb 21, 2024
Merged

fix: AmazonS3KeyValueAccess.isFile #23

merged 1 commit into from
Feb 21, 2024

Conversation

bogovicj
Copy link
Contributor

  • create prefixExists which should be used by isDirectory
  • changed implementation of keyExists, used by isFile
  • no longer returns true erroneously when an existing key has the queried key as a prefix (e.g. used to return true if 9.1 does not exist but 9.10 does)

@cmhulbert @axtimwalde

* create prefixExists which should be used by isDirectory
* changed implementation of keyExists, used by isFile
* no longer returns true erroneously when an existing key has the queried
  key as a prefix (e.g. used to return true if 9.1 does not exist but 9.10 does)
@bogovicj
Copy link
Contributor Author

This also fixes exceptions we would see like this the one below cased by
AmazonS3KeyValueAccess.exists erroneously returning true.

Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: 5ZZKCMTMQA6G3YBC; S3 Extended Request ID: 3pLOql4JbkaXuKB8NyM0mJXRfpBvd+rdt/YWbuGOpj7zlL88jZ3aVq2PePxwDO87mhsYfBH2mRM=; Proxy: null), S3 Extended Request ID: 3pLOql4JbkaXuKB8NyM0mJXRfpBvd+rdt/YWbuGOpj7zlL88jZ3aVq2PePxwDO87mhsYfBH2mRM=
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1879)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleServiceErrorResponse(AmazonHttpClient.java:1418)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1387)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1157)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:755)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:715)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:697)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:561)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:541)
	at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5470)
	at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5417)
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1525)
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1379)
	at org.janelia.saalfeldlab.n5.s3.AmazonS3KeyValueAccess$S3ObjectChannel.newInputStream(AmazonS3KeyValueAccess.java:559)
	at org.janelia.saalfeldlab.n5.zarr.ZarrKeyValueReader.readBlock(ZarrKeyValueReader.java:638)
	at org.janelia.saalfeldlab.n5.imglib2.N5CacheLoader.get(N5CacheLoader.java:120)
	at org.janelia.saalfeldlab.n5.imglib2.N5CacheLoader.get(N5CacheLoader.java:89)
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:135)

@bogovicj bogovicj merged commit e04af25 into master Feb 21, 2024
3 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.

1 participant