-
Notifications
You must be signed in to change notification settings - Fork 55
Description
This client was used for a long time on Windows without any issues. A couple of month ago we tried to use this client on .NET Core and we tested it on Linux and Windows.
In our project we use ZooKeeperClient a lot to read nodes and set watchers.
Windows version works flawlessly.
However, Linux version causes Connection reset by peer
exception.
I investigated this problem and read Zookeeper logs. I found out that Zookeeper didn't reset it's connection.
I didn't capture any tcp dumps, but I'm pretty sure there are no TCP RST packets.
Upgrading to .NET 5 makes the situation even worse. (ConnectionLossExceptions appear more often).
I decided to go deeper into the ZooKeeperClient code.
I found a check which causes false-detected connection loss.
Unfortunately, I was not able to detect what causes this effect and how to reproduce this problem. Looks like a problem with sockets on Linux.
Removing this check solves the problem.
Also, this client sends KeepAlive pings anyway, so if there IS a real connection loss, we will know about it in a soon time (either next time we try to send something or next ping).