Skip to content

Check peer's IDONTWANT state right before sending RPC #613

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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MarcoPolo
Copy link
Contributor

Related to #611.

A bit hacky, and there's a couple of footguns with the various RPC copies.

It would be nice to use a context for this, but it doesn't work well because the send is async so we'd have to keep the context around long enough for the send to finish and then clean it up.

Having the rpc check a map behind a lock is one of the cheapest options.

A slight improvement here would be to send the cancelled function separately from the RPC at the expense of more code changes.

Another approach is to change the priority queue to be aware of cancellation, but I think this looks a lot like this approach.

@MarcoPolo
Copy link
Contributor Author

This needs to be careful to not drop piggybacked messages (or at least re-queue them)

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