directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] directory-kerby git commit: Fixing some NPEs on shutdown
Date Mon, 15 May 2017 12:04:13 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk d09d191b1 -> 8da4fdc8c


Fixing some NPEs on shutdown


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

Branch: refs/heads/trunk
Commit: a2ee015375f976a021769ee52cb06f88f05edbd0
Parents: d09d191
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon May 15 12:57:52 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon May 15 12:57:52 2017 +0100

----------------------------------------------------------------------
 .../impl/DefaultInternalKdcServerImpl.java      | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/a2ee0153/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
index 3ffd877..4c63b04 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
@@ -80,19 +80,23 @@ public class DefaultInternalKdcServerImpl extends AbstractInternalKdcServer
{
     protected void doStop() throws Exception {
         super.doStop();
 
-        network.stop();
+        if (network != null) {
+            network.stop();
+        }
 
-        executor.shutdown();
+        if (executor != null) {
+            executor.shutdown();
 
-        try {
-            boolean terminated = false;
-            do {
-                // wait until the pool has terminated
-                terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
-            } while (!terminated);
-        } catch (InterruptedException e) {
-            executor.shutdownNow();
-            LOG.warn("waitForTermination interrupted");
+            try {
+                boolean terminated = false;
+                do {
+                    // wait until the pool has terminated
+                    terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
+                } while (!terminated);
+            } catch (InterruptedException e) {
+                executor.shutdownNow();
+                LOG.warn("waitForTermination interrupted");
+            }
         }
 
         LOG.info("Default Internal kdc server stopped.");


Mime
View raw message