Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close translog writer if exception on write channel #29401

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Consistency
jasontedor committed Apr 6, 2018
commit f9a88eb6216155c6b7413fc59d5e0cb18e49aab3
Original file line number Diff line number Diff line change
@@ -587,7 +587,11 @@ public Operation readOperation(Location location) throws IOException {
try {
return current.read(location);
} catch (final IOException e) {
closeOnTragicEvent(e);
try {
closeOnTragicEvent(e);
} catch (final Exception inner) {
e.addSuppressed(inner);
}
throw e;
Copy link
Contributor

Choose a reason for hiding this comment

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

The other calls to closeOnTragicEvent are all of the form

try {
    closeOnTragicEvent(ex);
} catch (final Exception inner) {
    ex.addSuppressed(inner);
}
throw ex;

which does not make any sense btw when you look at closeOnTragicEvent which already takes care of exceptions that happen during closing. Can you unify the code in this class?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I would like to do this in an immediate follow-up to this one. For now I pushed: f9a88eb

}
} else {