Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

pubsub makes no guarantee on Windows and with go-ipfs #188

Merged
merged 2 commits into from
Mar 9, 2018

Conversation

richardschneider
Copy link
Contributor

Skip some tests because pubsub, go floodsub, does not make any guarantee on message delivery.

First reported in ipfs-inactive/js-ipfs-http-client#648

1) .pubsub multiple nodes connected multiple nodes receive multiple messages:
     Error: Timeout of 80000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

2) .pubsub multiple nodes connected load tests send/receive 10k messages:
     Error: Timeout of 80000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

@daviddias
Copy link
Contributor

@richardschneider this looks like an incorrect assessment. The tests have shown only that go-ipfs misses delivering messages to itself (having the same node be the publisher and the subscriber) only on Windows which tells us that there might be some real issue and not just a protocol design. There have been more users that reported the same.

@richardschneider
Copy link
Contributor Author

Took a look at go-floodsub and this code looks suspicious

binary.BigEndian.PutUint64(seqno, uint64(time.Now().UnixNano()))

Duplicate sequence number can be produced

  • if the resolution of the clock is not nanoseconds, or
  • mutliple publish events are received within the resolution of the clock

@daviddias daviddias changed the title pubsub makes no guarantee pubsub makes no guarantee on Windows and with go-ipfs Jan 12, 2018
@ghost ghost assigned daviddias Jan 12, 2018
@daviddias
Copy link
Contributor

@richardschneider added a check to see if the test is being run with go-ipfs. However, we should also check if it is Windows given that the issue only happens there.

We can't use the os module as it wouldn't work in the Browser. Open to ideas :)

@mkg20001
Copy link
Contributor

@diasdavid Maybe aegir could set an environment variable like AEGIR_OS which could be included in the browser.

@richardschneider
Copy link
Contributor Author

@diasdavid The issue was not really Windows related but was related to the resolution of the system clock; see issue libp2p/go-libp2p-pubsub#52.

The fix is in the pipe-line. So it should be resolved in the next go release.

Let's merge this but raise an issue to re-test when next go release is available.

@daviddias daviddias removed their assignment Jan 22, 2018
@daviddias
Copy link
Contributor

@Stebalien ETA for the next go-ipfs release?

@richardschneider
Copy link
Contributor Author

@diasdavid @Stebalien still waiting on the next go release, any estimate?

@Stebalien
Copy link
Contributor

"soon", unfortunately, this is a very big release. We need to get ipfs/kubo#4610 merged first, then test it, and then fix any fallout.

@daviddias
Copy link
Contributor

@richardschneider let's do a skip on Windows + go-ipfs for these tests and add a // TODO to follow up after release

@richardschneider
Copy link
Contributor Author

@diasdavid Code to skip if go-ipfs and TODO are already in place. This is not a windows issue.

RTM

@ghost ghost assigned vmx Mar 7, 2018
@vmx
Copy link
Contributor

vmx commented Mar 7, 2018

Tested with js-ipfs (Linux) and js-ipfs-api (Linux, Windows).

js/src/pubsub.js Outdated
@@ -13,6 +13,11 @@ const whilst = require('async/whilst')
const each = require('async/each')
const hat = require('hat')

let isWindows = false
if (process.platform && process.platform === 'win32') {
Copy link
Contributor

@victorb victorb Mar 8, 2018

Choose a reason for hiding this comment

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

const isWindows = process.platform && process.platform === 'win32'

Doesn't standard warn you here that this is a uneccessary conditional?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. I didn't get a warning but fixed it nonetheless.

@daviddias daviddias merged commit 0df216f into master Mar 9, 2018
@daviddias daviddias deleted the pubsub-tests branch March 9, 2018 00:13
@ghost ghost removed the in progress label Mar 9, 2018
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.

6 participants