keith-turner commented on a change in pull request #1037: Switch to leader
latch WIP
URL: https://github.com/apache/fluo/pull/1037#discussion_r193124962
##########
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:
I can use the guava sleep uninterruptably
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services