Skip to content

Commit

Permalink
ZOOKEEPER-2678: Fixed another race
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert (Bobby) Evans committed Jan 30, 2017
1 parent f705293 commit f57c384
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,14 @@ public void converseWithFollower(InputArchive ia, OutputArchive oa,

// Make sure the data was recorded in the filesystem ok
ZKDatabase zkDb2 = new ZKDatabase(new FileTxnSnapLog(logDir, snapDir));
start = System.currentTimeMillis();
zkDb2.loadDataBase();
while (zkDb2.getSessionWithTimeOuts().isEmpty() && (System.currentTimeMillis() - start) < 50) {
Thread.sleep(1);
zkDb2.loadDataBase();
}
LOG.info("zkdb2 sessions:" + zkDb2.getSessions());
LOG.info("zkdb2 with timeouts:" + zkDb2.getSessionWithTimeOuts());
Assert.assertNotNull(zkDb2.getSessionWithTimeOuts().get(4L));
} finally {
recursiveDelete(tmpDir);
Expand Down

0 comments on commit f57c384

Please sign in to comment.