abbccdda commented on a change in pull request #8857:
URL: https://github.com/apache/kafka/pull/8857#discussion_r439556229



##########
File path: core/src/main/scala/kafka/server/FinalizedFeatureChangeListener.scala
##########
@@ -143,10 +142,15 @@ class FinalizedFeatureChangeListener(zkClient: 
KafkaZkClient) extends Logging {
   private class ChangeNotificationProcessorThread(name: String) extends 
ShutdownableThread(name = name) {
     override def doWork(): Unit = {
       try {
-        ignoring(classOf[InterruptedException]) {
-          queue.take.updateLatestOrThrow()
-        }
+        queue.take.updateLatestOrThrow()
       } catch {
+        case ie: InterruptedException =>
+          // While the queue is empty and this thread is blocking on taking an 
item from the queue,
+          // a concurrent call to FinalizedFeatureChangeListener.close() could 
interrupt the thread
+          // and cause an InterruptedException to be raised from queue.take(). 
In such a case, it is
+          // safe to ignore the exception if the thread is being shutdown. We 
raise the exception
+          // here again, because, it is ignored by ShutdownableThread if it is 
shutting down.

Review comment:
       nit: if it is shutting down -> when shutting down.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to