Skip to content
Merged
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 @@ -571,7 +571,12 @@ public void safeRun() {

// error out all pending adds during closing, the callbacks shouldn't be
// running under any bk locks.
errorOutPendingAdds(rc, pendingAdds);
try {
errorOutPendingAdds(rc, pendingAdds);
} catch (Throwable e) {
closePromise.completeExceptionally(e);
Copy link
Member

@zymap zymap Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there has an exception, do we still need to do the tearDownWriteHandleState() and MetadataUpdateLoop operations?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it still needs the following operations. Catch this exception just to ensure the closePromise can complete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't "completeExceptionally" or "complete" the closePromise twice

return;
}

if (prevHandleState != HandleState.CLOSED) {
if (LOG.isDebugEnabled()) {
Expand Down