-
Notifications
You must be signed in to change notification settings - Fork 414
Description
It seems the LogstashTcpSocketAppender may loose events in its onEvent() method if it fails to send it for 5 times in a row. It may for instance fail to send the event because the connection has been dropped by the remote peer or the encoder failed to encode it.
In case of a poison event (encoder failed to process it), then it is indeed safer to discard the event and proceed with the next one. In this case there is no need to retry 5 times - it can be discarded immediately. And has a comment in the code says, there is no need to reopen the socket as it won't help in this case...
But when the failure is caused by a broken connection, I think the appender should not drop the event but should rather keep trying to send it until it succeed. Think about a scenario where the remote peer drops the connection immediately after it is established. In this case, the onSend() method will quickly iterate over the 5 allowed attempts and drop the message!
What do you think ?