-
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: re-sort queue after adding tasks #221
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When tasks are added to an existing list of tasks for a given peer, we need to sort the queue to ensure the order is correct, otherwise we never process pending tasks as task lists with pending tasks need to be moved up the queue. Fixes the build problems exposed in ipfs/js-ipfs#2992 Also upgrade aegir to a safe version.
achingbrain
added a commit
that referenced
this pull request
May 7, 2020
Builds on the work in #221 I see intermittant but frequent CI errors with js-ipfs, usually after a test has finished and the ndoes are being torn down. Getting it to do some additional logging reveals bitswap is crashing when it cannot send a message to a remote peer due to the libp2p dial failing: ```console ipfs: [stdout] Error: stream ended before 1 bytes became available ipfs: at /home/travis/build/ipfs/js-ipfs/node_modules/it-reader/index.js:37:9 ipfs: at processTicksAndRejections (internal/process/task_queues.js:97:5) ipfs: at async /home/travis/build/ipfs/js-ipfs/node_modules/it-length-prefixed/src/decode.js:80:20 ipfs: at async oneChunk (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/multistream.js:12:20) ipfs: at async Object.exports.read (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/multistream.js:34:15) ipfs: at async module.exports (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/select.js:21:19) ipfs: at async ClassIsWrapper.newStream [as _newStream] (/home/travis/build/ipfs/js-ipfs/node_modules/libp2p/src/upgrader.js:251:40) ipfs: at async ClassIsWrapper.newStream (/home/travis/build/ipfs/js-ipfs/node_modules/libp2p-interfaces/src/connection/connection.js:172:34) ipfs: at async Network.sendMessage (/home/travis/build/ipfs/js-ipfs/node_modules/ipfs-bitswap/src/network.js:147:34) ipfs: at async DecisionEngine._processTasks (/home/travis/build/ipfs/js-ipfs/node_modules/ipfs-bitswap/src/decision-engine/index.js:124:5) { ipfs: code: 'ERR_UNSUPPORTED_PROTOCOL', ipfs: buffer: BufferList { _bufs: [], length: 0 } ipfs: } ``` This PR adds a try/catch around network send operations. At the moment it just dumps the request, I'm not sure if we want to add a retry in there or something.
dirkmc
approved these changes
May 7, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 👍
dirkmc
pushed a commit
that referenced
this pull request
May 7, 2020
* fix: survive not being able to send messages to peers Builds on the work in #221 I see intermittant but frequent CI errors with js-ipfs, usually after a test has finished and the ndoes are being torn down. Getting it to do some additional logging reveals bitswap is crashing when it cannot send a message to a remote peer due to the libp2p dial failing: ```console ipfs: [stdout] Error: stream ended before 1 bytes became available ipfs: at /home/travis/build/ipfs/js-ipfs/node_modules/it-reader/index.js:37:9 ipfs: at processTicksAndRejections (internal/process/task_queues.js:97:5) ipfs: at async /home/travis/build/ipfs/js-ipfs/node_modules/it-length-prefixed/src/decode.js:80:20 ipfs: at async oneChunk (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/multistream.js:12:20) ipfs: at async Object.exports.read (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/multistream.js:34:15) ipfs: at async module.exports (/home/travis/build/ipfs/js-ipfs/node_modules/multistream-select/src/select.js:21:19) ipfs: at async ClassIsWrapper.newStream [as _newStream] (/home/travis/build/ipfs/js-ipfs/node_modules/libp2p/src/upgrader.js:251:40) ipfs: at async ClassIsWrapper.newStream (/home/travis/build/ipfs/js-ipfs/node_modules/libp2p-interfaces/src/connection/connection.js:172:34) ipfs: at async Network.sendMessage (/home/travis/build/ipfs/js-ipfs/node_modules/ipfs-bitswap/src/network.js:147:34) ipfs: at async DecisionEngine._processTasks (/home/travis/build/ipfs/js-ipfs/node_modules/ipfs-bitswap/src/decision-engine/index.js:124:5) { ipfs: code: 'ERR_UNSUPPORTED_PROTOCOL', ipfs: buffer: BufferList { _bufs: [], length: 0 } ipfs: } ``` This PR adds a try/catch around network send operations. At the moment it just dumps the request, I'm not sure if we want to add a retry in there or something.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When tasks are added to an existing list of tasks for a given peer, we need to sort the queue to ensure the order is correct, otherwise we never process pending tasks as task lists with pending tasks need to be moved up the queue.
Fixes the build problems exposed in ipfs/js-ipfs#2992
Also upgrades aegir to a safe version.