Skip to content

Commit

Permalink
Fixing Null pointer exception in finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
n3nash authored and vinothchandar committed Aug 22, 2018
1 parent 88274b8 commit 3746ace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ public List<HoodieRollbackStat> rollback(JavaSparkContext jsc, List<String> comm
"Failed to rollback for commit " + commit, io);
} finally {
try {
writer.close();
if (writer != null) {
writer.close();
}
} catch (IOException io) {
throw new UncheckedIOException(io);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 3746ace

Please sign in to comment.