Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import kafka.zookeeper.{StateChangeHandler, ZNodeChangeHandler}
import org.apache.kafka.common.internals.FatalExitError

import scala.concurrent.TimeoutException
import scala.util.control.Exception.ignoring

/**
* Listens to changes in the ZK feature node, via the ZK client. Whenever a change notification
Expand Down Expand Up @@ -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]) {
Comment thread
kowshik marked this conversation as resolved.
Outdated
error("Failed to process feature ZK node change event. The broker will eventually exit.", e)
throw new FatalExitError(1)
}
}
}
}
Expand Down