Skip to content

Commit 0f152fc

Browse files
ppatiernoHao Geng
authored and
Hao Geng
committed
Catch NoSuchFileException on load failed brokers list (#2255)
1 parent d2e9806 commit 0f152fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/detector/AbstractBrokerFailureDetector.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.io.IOException;
1616
import java.nio.charset.StandardCharsets;
1717
import java.nio.file.Files;
18+
import java.nio.file.NoSuchFileException;
1819
import java.nio.file.attribute.PosixFilePermission;
1920
import java.util.HashMap;
2021
import java.util.HashSet;
@@ -118,7 +119,7 @@ String loadPersistedFailedBrokerList() {
118119
String failedBrokerListString = null;
119120
try {
120121
failedBrokerListString = readFileToString(_failedBrokersFile, StandardCharsets.UTF_8);
121-
} catch (FileNotFoundException fnfe) {
122+
} catch (FileNotFoundException | NoSuchFileException fnfe) {
122123
// This means no previous failures have ever been persisted in the file.
123124
failedBrokerListString = "";
124125
} catch (IOException ioe) {

0 commit comments

Comments
 (0)