-
Notifications
You must be signed in to change notification settings - Fork 103
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
Disordered Ack messages will be missed #103
Comments
This problem will last even after merging #82 |
@tagomoris Are you already working on this? 🙂 About the implementation details, I have the following solution in mind that would be lock-free:
My only concern with this solution is regarding #104. |
I've not worked on this yet - no plans for now. |
Currently, the
write()
function will wait for the ack message of the message sent. And reading ack messages from a connection will be processed in the order of written messages.If the series of ack messages are disordered (it can happen), arrived messages will be missed and the original messages will be re-sent to the server. It is not a critical problem (because sending messages are retried), but it may cause a problem about highly heavier traffic with at-least-once configuration.
A possible solution could be (solution is not only this way, of course):
write()
will set themsg.ack
value to a Set (with locking)write()
lets a goroutine read response messages from the connectionAckResp.Ack
from the Set (with locking)write()
will wait until the ack value will be removed from the Set (or timeout)write()
will retry to send the messageThe text was updated successfully, but these errors were encountered: