Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix: improve resiliency of internals _send #84

Merged
merged 1 commit into from
Oct 1, 2018
Merged

Conversation

jacobheun
Copy link
Contributor

@jacobheun jacobheun commented Oct 1, 2018

  • This also updates dependencies to the latest

The js-libp2p tests exposed an issue with the latest libp2p-mplex, where because Multiplex._send() is potentially doing 2 pushes, we can get into a bad state where readable.push() returns false, but we still have data to give. This could result in streams not closing properly, which was happening in the libp2p tests that exposed the issue.

This PR concatenates the varint and data pushes (if there is data) into a single push. This avoids the scenario of there being residual data to send when .push returns false.

You can see the passing build of libp2p using this branch here: https://ci.ipfs.team/blue/organizations/jenkins/libp2p%2Fjs-libp2p/detail/test%2Fgoodbye-mplex/2/pipeline

@ghost ghost assigned jacobheun Oct 1, 2018
@ghost ghost added the status/in-progress In progress label Oct 1, 2018
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants