-
Notifications
You must be signed in to change notification settings - Fork 186
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
PubSub sometimes failing #52
Comments
this code looks suspicious
A duplicate sequence number can be produced when a second publish event is received within the resolution of the clock. If this occurs, then the second publish event will not be relayed. On Windows, the default clock resolution is 15.6 ms, but it appears go changes it to 1ms. This is more that adequate to produce a duplicate sequence number. |
Yes, that looks like a bug. We should just use an atomic counter (maybe start at the current unix time to better handle restarts). |
@Stebalien Or maybe concatenating the time with an atomic counter. |
@richardschneider good point (I thought we had to try to fit this into a 64bit int but apparently not). |
Yeah, the 1ms resolution is not enough for real-time or bursty applications; definitely a bug. |
C# test and JS test are intermittently failing. Both are publishing multiple messages and then counting the subscribed messages.
It appears that some published messages are not being relayed to the subscribed channels. In the C# test both publisher and subscriber are on the same peer.
NOTE: these tests are running on Windows. This was first detected in ipfs-inactive/js-ipfs-http-client#648
The text was updated successfully, but these errors were encountered: