cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject git commit: Fix shutdown when run as Windows service
Date Fri, 31 Oct 2014 16:54:18 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 e3f4c6def -> a29ee07e3


Fix shutdown when run as Windows service

patch by jmckenzie, reviewed by pthompson for CASSANDRA-8136


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

Branch: refs/heads/cassandra-2.1
Commit: a29ee07e301e1d3985529676ab04d5f4743c25f4
Parents: e3f4c6d
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Fri Oct 31 11:52:57 2014 -0500
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Fri Oct 31 11:52:57 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                | 1 +
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a29ee07e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f3201a1..494fb93 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.2
+ * Fix shutdown when run as Windows service (CASSANDRA-8136)
  * Fix DESCRIBE TABLE with custom indexes (CASSANDRA-8031)
  * Fix race in RecoveryManagerTest (CASSANDRA-8176)
  * Avoid IllegalArgumentException while sorting sstables in

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a29ee07e/src/java/org/apache/cassandra/service/CassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index e68dc26..38d0414 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -401,15 +401,20 @@ public class CassandraDaemon
     /**
      * Stop the daemon, ideally in an idempotent manner.
      *
-     * Hook for JSVC
+     * Hook for JSVC / Procrun
      */
     public void stop()
     {
-        // this doesn't entirely shut down Cassandra, just the RPC server.
+        // On linux, this doesn't entirely shut down Cassandra, just the RPC server.
         // jsvc takes care of taking the rest down
         logger.info("Cassandra shutting down...");
         thriftServer.stop();
         nativeServer.stop();
+
+        // On windows, we need to stop the entire system as prunsrv doesn't have the jsvc
hooks
+        // We rely on the shutdown hook to drain the node
+        if (!FBUtilities.isUnix())
+            System.exit(0);
     }
 
 


Mime
View raw message