fluo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #1037: Switch to leader latch WIP
Date Tue, 05 Jun 2018 02:01:57 GMT
ctubbsii commented on a change in pull request #1037: Switch to leader latch WIP
URL: https://github.com/apache/fluo/pull/1037#discussion_r192926817
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
 ##########
 @@ -357,8 +419,17 @@ public synchronized void stop() throws Exception {
       if (curatorFramework.getState().equals(CuratorFrameworkState.STARTED)) {
         pathChildrenCache.getListenable().removeListener(this);
         pathChildrenCache.close();
-        leaderSelector.close();
-        curatorFramework.getConnectionStateListenable().removeListener(this);
+        leaderLatch.close();
+
+        execService.shutdown();
+
+        execService.awaitTermination(10, TimeUnit.SECONDS);
+
+        curatorFramework.getConnectionStateListenable().removeListener(cnxnListener);
+
+        // leaderLatch.close() schedules a background delete, give it a chance to process
before
+        // closing curator... this is done to avoid spurious exceptions, see CURATOR-467
+        Thread.sleep(250);
 
 Review comment:
   An `InterruptedException` here will prevent the `curatorFramework.close()` on the next
line. Maybe do something like the following?
   
   ```java
   try {
     Thread.sleep(250);
   } finally {
     curatorFramework.close();
   }
   ```

----------------------------------------------------------------
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

Mime
View raw message