From 4fb36975139140fbbb58dd3ccbf0d5e1cc28fe31 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Wed, 23 Sep 2009 02:21:31 +0000
Subject: [PATCH] - [Issue 4060]  server.pid missing after stop / start sequence : make sure the server lock file stays locked til JVM exit to prevent another server process from starting while the current server process is still shutting down. in-core restarts should always have the server lock file locked due to the same JVM instance/process the lock originally belongs to still being their JVM instance/process on restart.

---
 opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java |   26 --------------------------
 opendj-sdk/opends/src/messages/messages/core.properties                  |    4 ----
 2 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/opendj-sdk/opends/src/messages/messages/core.properties b/opendj-sdk/opends/src/messages/messages/core.properties
index 95ec06d..686477e 100644
--- a/opendj-sdk/opends/src/messages/messages/core.properties
+++ b/opendj-sdk/opends/src/messages/messages/core.properties
@@ -715,10 +715,6 @@
 FATAL_ERR_CANNOT_ACQUIRE_EXCLUSIVE_SERVER_LOCK_343=The Directory Server could \
  not acquire an exclusive lock on file %s:  %s.  This generally means that \
  another instance of this server is already running
-SEVERE_WARN_CANNOT_RELEASE_EXCLUSIVE_SERVER_LOCK_344=An error occurred while \
- attempting to release the exclusive server lock held on file %s:  %s.  This \
- lock should be automatically cleaned when the Directory Server process exits, \
- so no additional action should be necessary
 INFO_ERROR_CATEGORY_TASK_345=task
 MILD_ERR_MODIFY_ATTR_IS_NO_USER_MOD_346=Entry %s cannot be modified because \
  the modification attempted to update attribute %s which is defined as \
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
index 713686e..52f3984 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -8314,8 +8314,6 @@
             logError(message);
             // FIXME -- Do we need to send an admin alert?
           }
-
-          serverLocked = false;
         }
         catch (Exception e2)
         {
@@ -8346,30 +8344,6 @@
       ec.finalizeEntryCache();
     }
 
-    // Release the exclusive lock for the Directory Server process.
-    String lockFile = LockFileManager.getServerLockFileName();
-    try
-    {
-      StringBuilder failureReason = new StringBuilder();
-      if (! LockFileManager.releaseLock(lockFile, failureReason))
-      {
-        message = WARN_CANNOT_RELEASE_EXCLUSIVE_SERVER_LOCK.get(
-            lockFile, String.valueOf(failureReason));
-        logError(message);
-      }
-    }
-    catch (Exception e)
-    {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
-
-      message = WARN_CANNOT_RELEASE_EXCLUSIVE_SERVER_LOCK.get(
-          lockFile, stackTraceToSingleLineString(e));
-      logError(message);
-    }
-
     // Deregister all workflows.
     WorkflowImpl.deregisterAllOnShutdown();
 

--
Gitblit v1.10.0