You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/06/12 07:40:40 UTC

[GitHub] [kafka] kowshik commented on a change in pull request #8857: KAFKA-10157: Fix broken tests due to InterruptedException from FinalizedFeatureChangeListener

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



##########
File path: core/src/main/scala/kafka/server/FinalizedFeatureChangeListener.scala
##########
@@ -143,13 +142,17 @@ 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 e: Exception => {
-          error("Failed to process feature ZK node change event. The broker will eventually exit.", e)
-          throw new FatalExitError(1)
+          // We ignore 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 since the thread is being shutdown.
+          if (!e.isInstanceOf[InterruptedException]) {

Review comment:
       Done.




----------------------------------------------------------------
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:
users@infra.apache.org