symat commented on a change in pull request #1301: ZOOKEEPER-3774: Close quorum
socket asynchronously on the leader to a…
URL: https://github.com/apache/zookeeper/pull/1301#discussion_r408034404
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerHandler.java
##########
@@ -1150,4 +1140,33 @@ public void setFirstPacket(boolean value) {
needOpPacket = value;
}
+ void closeSocket() {
+ if (sock != null && !sock.isClosed() &&
sockBeingClosed.compareAndSet(false, true)) {
+ LOG.error("Unexpected exception causing shutdown while sock is
still open");
Review comment:
if I am right, when we are here, we already logged out the exception, if we
had any.
But we can also get here from the `shutdown()` function, when we close the
socket just without catching any exceptions.
What about instead of `LOG.error("Unexpected exception...` just print out a
`LOG.info` about closing the socket, and also indicating in the logs if we will
do it sync or async?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services