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

Audit messages are lost when other side closes (TCP) connection #1355

Open
jodue opened this issue Oct 11, 2023 · 0 comments
Open

Audit messages are lost when other side closes (TCP) connection #1355

jodue opened this issue Oct 11, 2023 · 0 comments

Comments

@jodue
Copy link

jodue commented Oct 11, 2023

Sometimes when an (TCP) audit connection is open for a longer period (say 1h) the server side may terminate the connection. In such cases the client side is not informed that the socket is in fact dead. The AuditLogger does implement a reconnect logic but this only works after the first packet could not be delivered. The main problem is that out.flush() does not block until the packet was delivered (ACK) but returns after the packet was entered successfully into the OS network stack. The Socket (and the OutputStream) is only marked as broken and fails with an IOException on the next write operation after the TCP layer gives up the retransmission.

To Reproduce
Steps to reproduce the behavior:

  1. Configure an AuditLogger with a TCP connection and send one audit message.
  2. Ensure that the server side kills the socket eg. by setting a short IdleTimeout on the server side.
  3. Send an audit message
  4. Message is dropped silently and not retransmitted

Expected behavior
Audit message should not be lost in case of connection problems when using TCP.

Screenshots
Network dump when the message is retransmitted by TCP logic becaue of missing ACK. After 5 failed attempts the packet is dropped ~6 seconds later. This is not handled in the java code!
image

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

No branches or pull requests

1 participant