ZooKeeper keeps getting EndOfStreamException, causing a crash

I was able to solve the problem by deleting all zookeeper snapshots and log files from the server running ZooKeeper. I don't know why this made a difference, but it has been running fine for the last 22 hours.


**This exception is an indicator of the end of the data stream of a session. It usually occurs when closing a connection to zookeeper. This exception does not signal a defect on the zookeeper side. Instead, it shows a connection to client is reset or closed. So please ignore the warning.

2020-08-17 09:05:05 WARN NIOServerCnxn:368 - caught end of stream exception EndOfStreamException: Unable to read additional data from client sessionid 0x373fb86e57b0018, likely client has closed socket at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:239) at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) at java.lang.Thread.run(Thread.java:748) 2020-08-17 09:05:05 INFO NIOServerCnxn:1044 - Closed socket connection for client /xx.xx.xx.xx:55380 which had sessionid 0x373fb86e57b0018