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

Messages are being written out of order #18

Closed
daviddias opened this issue Jan 12, 2017 · 6 comments
Closed

Messages are being written out of order #18

daviddias opened this issue Jan 12, 2017 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@daviddias
Copy link
Member

Although there is no promise that in a FloodSub network messages are delivered sequencially (due to retransmissions, forwarding etc), it should be impossible for 2 nodes connected over TCP, one publisher and one subscriber, to see the messages from the other arrived unordered.

See more here: ipfs/js-ipfs#644 (comment)

@daviddias daviddias added the kind/bug A bug in existing code (including security flaws) label Jan 12, 2017
@daviddias
Copy link
Member Author

This is mainly cause because the publish callback is called right away, even before the write, which in a case of thousands of messages being written, floods the timecache and forces it to start discarding.

@dignifiedquire
Copy link
Member

Which callback are you referring to? publish is sync on master.

@daviddias
Copy link
Member Author

Something is wrong, I thought initially that the API was 'false sync', but it actually might be a time-cache problem, @dignifiedquire do you have time to look into this #19 today?

@dignifiedquire
Copy link
Member

@diasdavid I am very confused right now, I cloned things and installed and linked but I can not reproduce the issue, after running the latest pubsub tests in js-ipfs about 10 times.

The only fixes I needed to pull in were: libp2p/js-libp2p-crypto#56 Could you please check if this works for you as well with that fix?

My suspicion is that the random value generation is broken in node4, resulting in incorrect id generation, resulting in the issue you were seeing.

@daviddias
Copy link
Member Author

Will test asap :)

@daviddias
Copy link
Member Author

Everything is fine now :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants