Skip to content

Mediators should not enqueue keep-alives for handovers with a backlog #39

@salcock

Description

@salcock

Keep alives are currently appended to the end of the buffer of data to send to the handover.

In the situation where we have a agency that has been absent for some time and therefore is having records queued up for it on the mediator, this leads to some keep alive failures.

If the keep alive response timeout is too low, then the keep alive may not even be sent to the agency before the timer expires, causing the handover to be dropped while clearing the backlog. The handover will likely reconnect and carry on, but it's not ideal and will likely cause concern for both users and agencies to see these connections continuing to drop.

Instead, we should avoid queuing a keep alive as long as there is data in the buffer to send via that handover, since keep alives should only be sent when the outgoing data connection is idle (as opposed to there being no incoming data for that handover coming from the collectors). We can instead restart the keep alive timer once the buffer is empty again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething broken in existing code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions