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

Add CancelRequest method to API #184

Closed
dirkmc opened this issue Aug 2, 2021 · 0 comments
Closed

Add CancelRequest method to API #184

dirkmc opened this issue Aug 2, 2021 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@dirkmc
Copy link
Collaborator

dirkmc commented Aug 2, 2021

Currently the only way to cancel a graphsync request is by cancelling the context passed to Request().

It's not possible to determine when all events for the request have been processed. So the calling code may take actions that assume the request has completed when in fact some events are still being processed. This can cause races, for example filecoin-project/lotus#6968 (comment)

Proposal: Add a method to the graphsync API that cancels the request and waits for all event queues for the request to be drained:
CancelRequest(graphsync.RequestID)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants