Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1705,10 +1705,12 @@ public void shutdown() {
this.interrupt();
getElectionAlg().shutdown();
}
try {
zkDb.close();
} catch (IOException ie) {
LOG.warn("Error closing logs ", ie);
if (zkDb != null) {
try {
zkDb.close();
} catch (IOException ie) {
LOG.warn("Error closing logs ", ie);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public void testQuorumPeerListendOnSpecifiedClientIP(@TempDir File dataDir) thro
peer2.shutdown();
}

@Test
public void testShutdownWithoutZkDbDoesNotThrow() throws Exception {
QuorumPeer peer = new QuorumPeer();
peer.shutdown();
}

@Test
public void testProcessReconfigWillRecreateSocketAddresses() throws IOException {
QuorumPeerConfig.setReconfigEnabled(true);
Expand Down