Skip to content

LogstashTcpSocketAppender may loose events in its onEvent() method #329

@brenuart

Description

@brenuart

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions