kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2468: SIGINT during Kafka server startup can leave server deadlocked
Date Fri, 28 Aug 2015 03:43:33 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 2fa8c7485 -> 8956004a5


KAFKA-2468: SIGINT during Kafka server startup can leave server deadlocked

As we handle exceptions or invalid states in Kafka server by shutting it down, there is no
reason to use exit() and not halt() in shutdown itself.

Author: asingh <asingh@cloudera.com>

Reviewers: Ewen Cheslack-Postava, Guozhang Wang

Closes #167 from SinghAsDev/KAFKA-2468


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/8956004a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/8956004a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/8956004a

Branch: refs/heads/trunk
Commit: 8956004a51a67c028f8acc73e82f4d1a3e4116c7
Parents: 2fa8c74
Author: Ashish Singh <asingh@cloudera.com>
Authored: Thu Aug 27 20:45:42 2015 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Thu Aug 27 20:45:42 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/KafkaServerStartable.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/8956004a/core/src/main/scala/kafka/server/KafkaServerStartable.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/KafkaServerStartable.scala b/core/src/main/scala/kafka/server/KafkaServerStartable.scala
index 0001331..df521b3 100644
--- a/core/src/main/scala/kafka/server/KafkaServerStartable.scala
+++ b/core/src/main/scala/kafka/server/KafkaServerStartable.scala
@@ -17,7 +17,6 @@
 
 package kafka.server
 
-import kafka.common.AppInfo
 import kafka.utils.Logging
 
 
@@ -43,7 +42,8 @@ class KafkaServerStartable(val serverConfig: KafkaConfig) extends Logging
{
     catch {
       case e: Throwable =>
         fatal("Fatal error during KafkaServerStable shutdown. Prepare to halt", e)
-        System.exit(1)
+        // Calling exit() can lead to deadlock as exit() can be called multiple times. Force
exit.
+        Runtime.getRuntime.halt(1)
     }
   }
 


Mime
View raw message