cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Improve handling of directory creation failures
Date Tue, 05 Feb 2013 23:41:29 GMT
Updated Branches:
  refs/heads/cassandra-1.2 ae3efc2d0 -> 7a90c7466


Improve handling of directory creation failures

patch by Aleksey Yeschenko; reviewed by Brandon Williams for
CASSANDRA-5196


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

Branch: refs/heads/cassandra-1.2
Commit: 7a90c7466fc3a4c372eb1d864bdb8229fdba6391
Parents: ae3efc2
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed Feb 6 02:39:40 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Feb 6 02:39:40 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 src/java/org/apache/cassandra/db/Directories.java  |    1 +
 .../org/apache/cassandra/io/util/FileUtils.java    |   20 ++++++++++++--
 3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a90c746/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8e13b66..bdab1c5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@
  * allow configuration of internode socket buffer (CASSANDRA-3378)
  * Make sstable directory picking blacklist-aware again (CASSANDRA-5193)
  * Correctly expire gossip states for edge cases (CASSANDRA-5216)
+ * Improve handling of directory creation failures (CASSANDRA-5196)
 
 
 1.2.1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a90c746/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Directories.java b/src/java/org/apache/cassandra/db/Directories.java
index 1f68f62..c0af0da 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -110,6 +110,7 @@ public class Directories
                 catch (FSError e) 
                 {
                     // don't just let the default exception handler do this, we need the
create loop to continue
+                    logger.error("Failed to create {} directory", dir);
                     FileUtils.handleFSError(e);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a90c746/src/java/org/apache/cassandra/io/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/FileUtils.java b/src/java/org/apache/cassandra/io/util/FileUtils.java
index ec0aeb6..69038fa 100644
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@ -370,9 +370,23 @@ public class FileUtils
         switch (DatabaseDescriptor.getDiskFailurePolicy())
         {
             case stop:
-                logger.error("Stopping the gossiper and the RPC server");
-                StorageService.instance.stopGossiping();
-                StorageService.instance.stopRPCServer();
+                if (StorageService.instance.isInitialized())
+                {
+                    logger.error("Stopping gossiper");
+                    StorageService.instance.stopGossiping();
+                }
+
+                if (StorageService.instance.isRPCServerRunning())
+                {
+                    logger.error("Stopping RPC server");
+                    StorageService.instance.stopRPCServer();
+                }
+
+                if (StorageService.instance.isNativeTransportRunning())
+                {
+                    logger.error("Stopping native transport");
+                    StorageService.instance.stopNativeTransport();
+                }
                 break;
             case best_effort:
                 // for both read and write errors mark the path as unwritable.


Mime
View raw message