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(iroh::downloader): remove hash from providers in two missed cases #1584

Conversation

divagant-martian
Copy link
Contributor

@divagant-martian divagant-martian commented Oct 6, 2023

Description

We weren't removing the hash of a request that was scheduled, became ready but couldn't be executed. This caused getting the next hash for a provider to pop a hash no longer necessary.

I added an invariant check for the provider map and it seems to be we missed a couple removals in #1480 so this fixes removal in cancellation as well

Notes & open questions

one small change, seemingly unrelated, is that the debug_assert now uses the debug version of the hash instead of display. This is because throughout the file we log the kind in debug, which in turn uses the debug impl for the hash. This difference made it a bit harder to follow the logs because the printed hash didn't match those in the rest of the logs. The change makes this consistent

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@divagant-martian divagant-martian changed the title fix(iroh::downloader): remove hash from providers when a request that became ready fails fix(iroh::downloader): remove hash from providers when a request that became ready fails Oct 6, 2023
@divagant-martian divagant-martian changed the title fix(iroh::downloader): remove hash from providers when a request that became ready fails fix(iroh::downloader): remove hash from providers in two missed cases Oct 6, 2023
@divagant-martian divagant-martian self-assigned this Oct 6, 2023
@divagant-martian divagant-martian added this pull request to the merge queue Oct 6, 2023
Merged via the queue into n0-computer:main with commit 068f0bd Oct 6, 2023
@divagant-martian divagant-martian deleted the remove-hash-from-provider-map branch October 6, 2023 13:50
@b5 b5 added this to the v0.7.0 milestone Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants