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

Support context cancellation in Gateway directory listings #9066

Open
3 tasks done
iand opened this issue Jun 28, 2022 · 0 comments
Open
3 tasks done

Support context cancellation in Gateway directory listings #9066

iand opened this issue Jun 28, 2022 · 0 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/gateway Topic gateway

Comments

@iand
Copy link
Contributor

iand commented Jun 28, 2022

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

Description

This is a low priority general enhancement to conserve resources when dealing with slow clients. Directory listings may be very large and take a long time to transfer and we should respect cancellation of the request context (due to timeout or explicit).

As of commit 862ce6b, directory listings iterate over an Ls of a UnixFS and do not check for context cancellation:

https://github.com/ipfs/go-ipfs/blob/862ce6bb8f6ce24b91ed3dc59e7406faed34f583/core/corehttp/gateway_handler_unixfs_dir.go#L117

The request context is available and could simply be checked during iteration

@iand iand added the kind/enhancement A net-new feature or improvement to an existing feature label Jun 28, 2022
@lidel lidel added topic/gateway Topic gateway P2 Medium: Good to have, but can wait until someone steps up labels Jul 19, 2022
@lidel lidel added this to the Best Effort Track milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/gateway Topic gateway
Projects
No open projects
Status: 🥞 Todo
2 participants