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
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
fix: revert to serialized pubsub operations (#319)
* fix: re-serialise operations that were serial before refactor
During the refactor I took the opportunity to parallelise some pubsub operations that didn't explicitly depend on each other. This worked perfectly while testing locally, but on CI it is a different story. I found that tests for js-ipfs-api (which are run against go-ipfs) failed for seemingly random reasons.
After much investigation I finally tried re-serialising the operations I had refactored to be parallel and the tests started to pass. It seems that the pubsub implementation in go-ipfs has some issues with concurrency.
I also found two intermittent issues with `swarm.connect` in go-ipfs (seen significantly more often on CI):
1. Issuing two calls to this function from the same node might end up in the second not actually creating a connection and no error message reported to the user
2. Even after the response to the user it takes a few milliseconds for a connection to actually be connected
I intend to open issues on go-ipfs and write examples demonstrating these problems.
I created a utility function `connect` to temporarily mitigate these issues in one place. The utility serialises calls from a single node to another and pauses after each to allow the connection to properly establish.
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
* fix: revert timout increase
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
* Update swarm.js
0 commit comments