Skip to content
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

Drop similarity-response messages with duplicate identifiers #526

Merged
merged 1 commit into from
Feb 13, 2017

Conversation

egbertbouman
Copy link
Member

@synctext
Copy link
Member

synctext commented Feb 7, 2017

class PingRequestCache(RandomNumberCache)
Polite RequestCache reminder, please do not forget about the None return value for the pop and/or get. Shocking state-of-the-code.

@egbertbouman
Copy link
Member Author

@synctext That wasn't the problem. I believe the issue was due to two messages arriving with the same message id (which is possible if one of them was delayed for more then 10s). Then, when both messsages get processed in the same batch, the check function did not complain about an invalid message id because for a batch of messages we first do all the checks, and then all the callbacks.

@egbertbouman egbertbouman changed the title WIP: Drop similarity-response messages with duplicate identifiers READY: Drop similarity-response messages with duplicate identifiers Feb 7, 2017
@synctext
Copy link
Member

synctext commented Feb 8, 2017

which is possible if one of them was delayed for more then 10s

Sadly that is not very realistic for network propagation times. I've had this bug on our university Gbit/s network. Network latency there is sub-ms. Can Dispersy be that overloaded that the message queue blocks it for 10+ seconds? Or is this another 16-bit identifier clash, only 65536 unique IDs possible, so birthday paradox kicks in?

@egbertbouman
Copy link
Member Author

@synctext Such a delay would most likely be due to Dispersy, yes, and this would only happen very rarely. The issue occurs if the message response takes more the 10s, so that's 2 messages (perhaps I wasn't clear on that).

@egbertbouman
Copy link
Member Author

egbertbouman commented Feb 8, 2017

Example of delays while waiting for similarity responses during ~4 hours. Measured from request_cache.add (in create_similarity_request) until request_cache.pop (in on_similarity_response). There are some gaps at the end of the graph due to internet connection troubles, but you get the idea.
image

@synctext
Copy link
Member

synctext commented Feb 8, 2017

wow, point proven with real data. End-to-end latency is epic slow.

@devos50 devos50 self-requested a review February 12, 2017 13:42
@devos50 devos50 changed the title READY: Drop similarity-response messages with duplicate identifiers Drop similarity-response messages with duplicate identifiers Feb 13, 2017
@devos50 devos50 merged commit d80b1c6 into Tribler:devel Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants