I’m not very familiar with low-level TCP details, but I would expect Logstash to send a FIN/ACK instead of a RST when closing the connection. This way, the session would close cleanly, and the agent could simply reconnect when it has data to send. Letting the session expire after client_inactivity_timeout makes sense — just not by sending a RST.
I’m glad I wasn’t the only one confused. Thanks a lot for clarifying the situation.
I don't think that is quite right. When TCP keepalives are enabled the TCP stack on the end that enabled them will send a keepalive ACK and the receiving TCP stack will ack it (the receiving TCP stack has no idea that it is a keepalive). logstash never sees the keepalive. It's entirely at the TCP level.
Keepalives provide rapid notification of the termination of the remote process or server, and also try to preserve the connection across any stateful components in the network (firewalls, NAT devices, etc.).
The application has no idea that TCP keepalives are happening (except to the extent that it may have enabled them when it opened the connection).
Typically an application would close using RST rather than FIN if it is uninterested in processing any additional data from the connection (including data already received).
That wording is not accuraret. There was an ACK, it wasn't logstash's ACK.
And the "ignoring" I mentioned is also a bit dubious wording, logstash didn't see then indeed.
Well yes, it (the application) might have no idea, and it (the TCP layer) just ACKs to packets that contain no data, so dont need processing by the application (logstash in this case).
But I guess both applications could use SO_KEEPALIVE. I'm not informed enough to comment on whether that would be better or not, for any definition of better, but I do know, as @vasek also discovered, that RSTs are a bit untidy when troubleshooting things.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.