You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "C0urante (via GitHub)" <gi...@apache.org> on 2023/08/28 14:05:03 UTC
[GitHub] [kafka] C0urante commented on a diff in pull request #14277: KAFKA-15392: Prevent shadowing RestServer shutdown exceptions
C0urante commented on code in PR #14277:
URL: https://github.com/apache/kafka/pull/14277#discussion_r1307471308
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestServer.java:
##########
@@ -348,6 +348,15 @@ public void stop() {
log.info("Stopping REST server");
try {
+ if (handlers.isRunning()) {
+ for (Handler handler : handlers.getHandlers()) {
+ try {
+ handler.stop();
+ } catch (Exception e) {
+ log.warn("Error while stopping " + handler, e);
+ }
Review Comment:
We could use `Utils::closeQuietly` here and below:
```suggestion
if (handler != null)
Utils.closeQuietly(handler::stop, handler.toString());
```
(The null check is currently unnecessary but can save us headaches in the future.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org