Skip to content

Conversation

@AmirWiener
Copy link
Contributor

If the syslog server have closed the connection it will send a TCP FIN. Current ensureSyslogServerConnection() implementation only check the socket state. Those checks don't cover the TCP FIN case.
In order to check it, we should try and read from the socket. If a FIN was sent, read() will return -1.
In such case we should mark the socket as invalid, and reconnect. If we won't, the next message we'll send will be rejected with a RST. No exception thrown outside to the caller, and no indication that the message was lost.

to reproduce:

  1. send a message (tcp handshake)
  2. stop and re start the syslog server (server send FIN)
  3. send a message (rejected with RST, no exception in the caller side)

…w connection.

If the syslog server have closed the connection it will send a TCP FIN.
Current ensureSyslogServerConnection() implementation only check the socket state.
Those checks don't cover the TCP FIN case.
In order to check it, we should try and read from the socket.
If a FIN was sent, read() will return -1.
In such case we should mark the socket as invalid, and reconnect.
If we won't, the next message we'll send will be rejected with a RST.
No exception thrown outside to the caller, and no indication that the message was lost.
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

Successfully merging this pull request may close these issues.

1 participant