Skip to content

Disordered Ack messages will be missed #103

Open
@tagomoris

Description

@tagomoris

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):

  1. write() will set the msg.ack value to a Set (with locking)
  2. write() lets a goroutine read response messages from the connection
  3. the goroutine will read a message from any of connections passed, and remove an AckResp.Ack from the Set (with locking)
  4. write() will wait until the ack value will be removed from the Set (or timeout)
  5. if it timed out, write() will retry to send the message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions