1
0

Fixing Null pointer exception in finally block

This commit is contained in:
Nishith Agarwal
2018-08-21 17:27:56 -07:00
committed by vinoth chandar
parent 88274b8261
commit 3746ace76a
2 changed files with 4 additions and 1 deletions

View File

@@ -296,7 +296,9 @@ public class HoodieMergeOnReadTable<T extends HoodieRecordPayload> extends
"Failed to rollback for commit " + commit, io);
} finally {
try {
writer.close();
if (writer != null) {
writer.close();
}
} catch (IOException io) {
throw new UncheckedIOException(io);
}

View File

@@ -72,6 +72,7 @@ public class HoodieLogFormatWriter implements HoodieLogFormat.Writer {
try {
this.output = fs.append(path, bufferSize);
} catch (RemoteException e) {
log.warn("Remote Exception, attempting to handle or recover lease", e);
handleAppendExceptionOrRecoverLease(path, e);
} catch (IOException ioe) {
if (ioe.getMessage().equalsIgnoreCase("Not supported")) {