usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: swallow exception if attempt to drop a keyspace during test setup and it has already been dropped
Date Wed, 09 Aug 2017 20:58:58 GMT
Repository: usergrid
Updated Branches:
  refs/heads/hotfix-20170728 874be4bb8 -> 936101ef5


swallow exception if attempt to drop a keyspace during test setup and it has already been
dropped


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

Branch: refs/heads/hotfix-20170728
Commit: 936101ef541cd983f10e65b2bafc07b78b08fd75
Parents: 874be4b
Author: Mike Dunker <mdunker@google.com>
Authored: Wed Aug 9 13:58:49 2017 -0700
Committer: Mike Dunker <mdunker@google.com>
Committed: Wed Aug 9 13:58:49 2017 -0700

----------------------------------------------------------------------
 .../migration/schema/MigrationManagerImpl.java    | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/936101ef/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index 19321fe..1d73906 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
@@ -79,12 +79,7 @@ public class MigrationManagerImpl implements MigrationManager {
         try {
 
             if (dropKeyspace) {
-                try {
                     dropKeyspace();
-                }
-                catch (Throwable t) {
-                    // keyspace may already have been dropped, swallow event
-                }
             }
 
             testAndCreateKeyspace();
@@ -139,6 +134,19 @@ public class MigrationManagerImpl implements MigrationManager {
      * Drop keyspace.
      */
     private void dropKeyspace() throws ConnectionException {
+
+        try {
+            keyspace.describeKeyspace();
+
+        }catch( NotFoundException nfe) {
+            logger.info("Received NotFoundException when attempting to describe keyspace.
 It does not exist");
+            return;
+        }
+        catch(Throwable t){
+            logger.info("dropKeyspace: describeKeyspace exception: {}", t.getMessage());
+            // swallow
+        }
+
         keyspace.dropKeyspace();
     }
 


Mime
View raw message