[ https://issues.apache.org/jira/browse/KAFKA-5483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442485#comment-16442485 ]
ASF GitHub Bot commented on KAFKA-5483: --------------------------------------- mimaison closed pull request #3452: KAFKA-5483: Shutdown of scheduler should come after LogManager URL: https://github.com/apache/kafka/pull/3452 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/src/main/scala/kafka/server/KafkaServer.scala b/core/src/main/scala/kafka/server/KafkaServer.scala index 0a87750d949..a67276959dd 100755 --- a/core/src/main/scala/kafka/server/KafkaServer.scala +++ b/core/src/main/scala/kafka/server/KafkaServer.scala @@ -590,8 +590,6 @@ class KafkaServer(val config: KafkaConfig, time: Time = Time.SYSTEM, threadNameP if (requestHandlerPool != null) CoreUtils.swallow(requestHandlerPool.shutdown()) - CoreUtils.swallow(kafkaScheduler.shutdown()) - if (apis != null) CoreUtils.swallow(apis.close()) CoreUtils.swallow(authorizer.foreach(_.close())) @@ -608,6 +606,8 @@ class KafkaServer(val config: KafkaConfig, time: Time = Time.SYSTEM, threadNameP if (logManager != null) CoreUtils.swallow(logManager.shutdown()) + CoreUtils.swallow(kafkaScheduler.shutdown()) + if (kafkaController != null) CoreUtils.swallow(kafkaController.shutdown()) if (zkUtils != null) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > Shutdown of scheduler should come after LogManager > -------------------------------------------------- > > Key: KAFKA-5483 > URL: https://issues.apache.org/jira/browse/KAFKA-5483 > Project: Kafka > Issue Type: Bug > Reporter: Jason Gustafson > Assignee: Mickael Maison > Priority: Major > > It seems like we shutdown the scheduler used by LogManager before shutting > down LogManager itself. This can lead to an IllegalStateException > {code} > "[2017-06-06 18:10:19,025] ERROR [ReplicaFetcherThread-14-111], Error due to > (kafka.server.ReplicaFetcherThread) > kafka.common.KafkaException: error processing data for partition > [akiraPricedProduct.global,10] offset 191893 > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2$$anonfun$apply$mcV$sp$1$$anonfun$apply$2.apply(AbstractFetcherThread.scala:170) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2$$anonfun$apply$mcV$sp$1$$anonfun$apply$2.apply(AbstractFetcherThread.scala:141) > at scala.Option.foreach(Option.scala:257) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2$$anonfun$apply$mcV$sp$1.apply(AbstractFetcherThread.scala:141) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2$$anonfun$apply$mcV$sp$1.apply(AbstractFetcherThread.scala:138) > at > scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) > at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2.apply$mcV$sp(AbstractFetcherThread.scala:138) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2.apply(AbstractFetcherThread.scala:138) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2.apply(AbstractFetcherThread.scala:138) > at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:234) > at > kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:136) > at > kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:103) > at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63) > Caused by: java.lang.IllegalStateException: Kafka scheduler is not running. > at kafka.utils.KafkaScheduler.ensureRunning(KafkaScheduler.scala:132) > at kafka.utils.KafkaScheduler.schedule(KafkaScheduler.scala:106) > at kafka.log.Log.roll(Log.scala:794) > at kafka.log.Log.maybeRoll(Log.scala:744) > at kafka.log.Log.append(Log.scala:405) > at > kafka.server.ReplicaFetcherThread.processPartitionData(ReplicaFetcherThread.scala:130) > at > kafka.server.ReplicaFetcherThread.processPartitionData(ReplicaFetcherThread.scala:42) > at > kafka.server.AbstractFetcherThread$$anonfun$processFetchRequest$2$$anonfun$apply$mcV$sp$1$$anonfun$apply$2.apply(AbstractFetcherThread.scala:153) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)