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

Return 404 for not-found zarr chunks #6381

Merged
merged 4 commits into from
Aug 8, 2022
Merged

Return 404 for not-found zarr chunks #6381

merged 4 commits into from
Aug 8, 2022

Conversation

normanrz
Copy link
Member

@normanrz normanrz commented Aug 6, 2022

Return 404 for not-found zarr chunks. Not sure if this plays well with the other currently in-review PRs for Zarr. Happy to close this one again, if you think that makes sense. I was just curious how a fix could be implemented.

Steps to test:

  • Assuming you have the l4_sample dataset and set it to "public":
  • curl -I http://localhost:9000/data/zarr/sample_organization/l4_sample/color/1-1-1/0.112.112.32 -> 200 Ok
  • curl -I http://localhost:9000/data/zarr/sample_organization/l4_sample/color/1-1-1/0.0.0.0 -> 404 Not found

Issues:


(Please delete unneeded items, merge only when none are left open)

@normanrz normanrz requested review from fm3 and leowe August 6, 2022 12:28
@normanrz normanrz self-assigned this Aug 6, 2022
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

I think there is a second method that needs your change, somewhere in VolumeTracingController. Otherwise, LGTM

@@ -212,7 +212,8 @@ class ZarrStreamingController @Inject()(
),
DataServiceRequestSettings(halfByte = false)
)
(data, _) <- binaryDataService.handleDataRequests(List(request))
(data, notFoundIndices) <- binaryDataService.handleDataRequests(List(request))
_ <- bool2Fox(notFoundIndices.size == 0) ~> "zarr.chunkNotFound" ~> 404
Copy link
Member

@fm3 fm3 Aug 6, 2022

Choose a reason for hiding this comment

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

Suggested change
_ <- bool2Fox(notFoundIndices.size == 0) ~> "zarr.chunkNotFound" ~> 404
_ <- bool2Fox(notFoundIndices.isEmpty) ~> "zarr.chunkNotFound" ~> NOT_FOUND

(possibly, NOT_FOUND needs to be be imported from play.api.http.Status.NOT_FOUND)

Copy link
Member Author

Choose a reason for hiding this comment

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

The other lines above also use ~> 404 should I replace them all?

Copy link
Member

Choose a reason for hiding this comment

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

if it’s no trouble, yes please :)

@normanrz
Copy link
Member Author

normanrz commented Aug 6, 2022

Seems to me VolumeTracingController already returns a 404 on missing chunks.

@bulldozer-boy bulldozer-boy bot merged commit 5e6097b into master Aug 8, 2022
@bulldozer-boy bulldozer-boy bot deleted the zarr-chunk-oob branch August 8, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zarr Streaming - 404 for out-of-bounding box chunks
2 participants