HBASE-25626 Possible Resource Leak in HeterogeneousRegionCountCostFunction

Signed-off-by Anoop Sam John <anoopsamjohn@apache.org>
Signed-off-by shahrs87 <shahrs87@gmail.com>
This commit is contained in:
Narges Shadab 2021-03-04 19:26:12 -08:00 committed by Anoop Sam John
parent eb640a6f0f
commit 13a86924d7
1 changed files with 7 additions and 4 deletions

View File

@ -221,11 +221,14 @@ public class HeterogeneousRegionCountCostFunction extends StochasticLoadBalancer
private List<String> readLines(BufferedReader reader) throws IOException {
final List<String> records = new ArrayList<>();
String line;
while ((line = reader.readLine()) != null) {
records.add(line);
try {
String line;
while ((line = reader.readLine()) != null) {
records.add(line);
}
} finally {
reader.close();
}
reader.close();
return records;
}