-
Notifications
You must be signed in to change notification settings - Fork 48
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: race condition when requesting the same block twice #214
Merged
achingbrain
merged 12 commits into
master
from
fix/race-condition-when-requesting-the-same-block
May 27, 2020
Merged
fix: race condition when requesting the same block twice #214
achingbrain
merged 12 commits into
master
from
fix/race-condition-when-requesting-the-same-block
May 27, 2020
Commits on May 19, 2020
-
fix: race condition when requesting the same block twice
When we call `blockstore.putMany`, some implementations will batch up all the `put`s and write them at once. This means that `blockstore.has` might not return `true` for a little while - if another request for a given block comes in before `blockstore.has` returns `true` it'll get added to the want list. If the block then finishes it's batch and finally a remote peer supplies the wanted block, the notifications that complete the second block request will never get sent and the process will hang idefinately. The change made here is to separate the sending of notifications out from putting things into the blockstore. If the blockstore has a block, but the block is still in the wantlist, send notifications that we now have the block.
Configuration menu - View commit details
-
Copy full SHA for 1fc09ed - Browse repository at this point
Copy the full SHA 1fc09edView commit details
Commits on May 20, 2020
-
Configuration menu - View commit details
-
Copy full SHA for fa2310e - Browse repository at this point
Copy the full SHA fa2310eView commit details -
fix: actually really actually use bitswap 1.2.0
We weren't using 1.2.0 in the protocol negotiation. Now we do.
Configuration menu - View commit details
-
Copy full SHA for 53c0790 - Browse repository at this point
Copy the full SHA 53c0790View commit details
Commits on May 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 7b331ce - Browse repository at this point
Copy the full SHA 7b331ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b2336f - Browse repository at this point
Copy the full SHA 9b2336fView commit details
Commits on May 22, 2020
-
feat: allow using abort controllers to abort block want notifications
- Key notifications by CID multihashes so one block can service multiple wants if they are for the same data but requested with difference CIDs - Pass in an AbortSignal to notifications and that tears down only the listeners set up for that invocation and rejects the current promise only when aborted - notifications.unwant will now reject all outstanding promises for that CID A follow up commit will handle removing things from the want list.
Configuration menu - View commit details
-
Copy full SHA for 8c0ed0a - Browse repository at this point
Copy the full SHA 8c0ed0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1874dc8 - Browse repository at this point
Copy the full SHA 1874dc8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5d81fc - Browse repository at this point
Copy the full SHA d5d81fcView commit details
Commits on May 26, 2020
-
Configuration menu - View commit details
-
Copy full SHA for bd676f0 - Browse repository at this point
Copy the full SHA bd676f0View commit details
Commits on May 27, 2020
-
Co-authored-by: dirkmc <dirkmdev@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ac1e2a8 - Browse repository at this point
Copy the full SHA ac1e2a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f88c55e - Browse repository at this point
Copy the full SHA f88c55eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d17c787 - Browse repository at this point
Copy the full SHA d17c787View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.