You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments