You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/02/27 14:41:40 UTC

[GitHub] anmolnar commented on a change in pull request #730: Zookeeper-3188: Improve resilience to network

anmolnar commented on a change in pull request #730: Zookeeper-3188: Improve resilience to network
URL: https://github.com/apache/zookeeper/pull/730#discussion_r260754702
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java
 ##########
 @@ -740,6 +772,18 @@ void shutdown(String reason) {
         isShutdown = true;
     }
 
+    synchronized void closeSockets() {
+        if (serverSockets != null)
+            for (ServerSocket serverSocket : serverSockets) {
+                if (!serverSocket.isClosed())
+                    try {
+                        serverSocket.close();
+                    } catch (IOException e) {
+                        LOG.warn("Ignoring unexpected exception during close" + serverSocket, e);
 
 Review comment:
   Please use built-in message formatter:
   ```
   LOG.warn("Ignoring unexpected exception during close {}", serverSocket, e);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services