Open
Description
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 connection- the goroutine will read a message from any of connections passed, and remove an
AckResp.Ack
from the Set (with locking) write()
will wait until the ack value will be removed from the Set (or timeout)- if it timed out,
write()
will retry to send the message
Metadata
Metadata
Assignees
Labels
No labels