-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
KAFKA-17285: Consider using Utils.closeQuietly
to replace CoreUtils.swallow
when handling Closeable objects
#16843
Conversation
Using |
@bboyleonp666 could you please grep code base to fix all similar issues? |
Sure. Let me take a look at the code base. |
@chia7712 While handling this, I have noticed that there are lots of methods that uses |
the |
I agree with you. I have already merged the commits in trunk. |
@bboyleonp666 please rebase code to fix build error. Also, please fix following usages:
|
@bboyleonp666 any updates? |
I was on a long trip just back to work recently. I will update this soon, thanks for reminding. |
cbd1e54
to
e13c873
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bboyleonp666 thanks for your updates
Since
The lines here use |
how about: |
Looks great. Let me apply this change to all the instances that I can find. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bboyleonp666 thanks for updated patch
@bboyleonp666 could you please fix conflicts? |
Hi @chia7712, thank you. Just resolved and waiting for the checks. |
@@ -766,14 +766,13 @@ class BrokerServer( | |||
CoreUtils.swallow(socketServer.shutdown(), this) | |||
if (brokerTopicStats != null) | |||
CoreUtils.swallow(brokerTopicStats.close(), this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BrokerTopicStats
extends Closeable
now, so you can apply Utils.closeQuietly
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. Let me update this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply this one in commit fd93c6b
Use
Utils.closeQuietly
to replaceCoreUtils.swallow
inkafka.network.Acceptor#closeAll
.Committer Checklist (excluded from commit message)