From 0d3cee173258aae07cb92f45f15b569a9db7baa6 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 07 Nov 2008 14:03:11 +0000
Subject: [PATCH] Fix for issue 3566 (Increase the timeout of the windows service and consider making it configurable).
---
opendj-sdk/opends/lib/opends_service.exe | 0
opendj-sdk/opends/src/build-tools/windows/service.c | 27 ++++++++++++++++++++-------
opendj-sdk/opends/lib/winlauncher.exe | 0
opendj-sdk/opends/lib/launcher_administrator.exe | 0
4 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opends/lib/launcher_administrator.exe b/opendj-sdk/opends/lib/launcher_administrator.exe
index dc40609..8ec549b 100644
--- a/opendj-sdk/opends/lib/launcher_administrator.exe
+++ b/opendj-sdk/opends/lib/launcher_administrator.exe
Binary files differ
diff --git a/opendj-sdk/opends/lib/opends_service.exe b/opendj-sdk/opends/lib/opends_service.exe
index dac8d18..db2e924 100755
--- a/opendj-sdk/opends/lib/opends_service.exe
+++ b/opendj-sdk/opends/lib/opends_service.exe
Binary files differ
diff --git a/opendj-sdk/opends/lib/winlauncher.exe b/opendj-sdk/opends/lib/winlauncher.exe
index ba44236..3357701 100755
--- a/opendj-sdk/opends/lib/winlauncher.exe
+++ b/opendj-sdk/opends/lib/winlauncher.exe
Binary files differ
diff --git a/opendj-sdk/opends/src/build-tools/windows/service.c b/opendj-sdk/opends/src/build-tools/windows/service.c
index bf56648..d2660df 100644
--- a/opendj-sdk/opends/src/build-tools/windows/service.c
+++ b/opendj-sdk/opends/src/build-tools/windows/service.c
@@ -515,16 +515,29 @@
if (spawn(command, FALSE) != -1)
{
// Try to see if server is really running
- int nTries = 10;
+ int nTries = 100;
+ char * nTriesEnv = getenv("OPENDS_WINDOWS_SERVICE_START_NTRIES");
BOOL running = FALSE;
+ if (nTriesEnv != NULL)
+ {
+ nTries = (int)strtol(nTriesEnv, (char **)NULL, 10);
+ if (nTries <= 0)
+ {
+ nTries = 100;
+ }
+ }
+ else
+ {
+ debug("OPENDS_WINDOWS_SERVICE_START_NTRIES is not set. Using default 50 tries.");
+ }
debug(
"doStartApplication: the spawn of the process worked. Command: '%s'",
command);
- // Wait to be able to launch the java process in order it to free the lock
+ // Wait to be able to launch the java process in order it to get the lock
// on the file.
- debug("Sleeping for 3 seconds to allow the process to free the lock.");
- Sleep(3000);
+ debug("Sleeping for 5 seconds to allow the process to get the lock.");
+ Sleep(5000);
while ((nTries > 0) && !running)
{
nTries--;
@@ -534,9 +547,9 @@
}
if (!running)
{
- debug("Sleeping for 2 seconds to allow the process to free the lock. %d tries remaining.",
+ debug("Sleeping for 5 seconds to allow the process to get the lock. %d tries remaining.",
nTries);
- Sleep(2000);
+ Sleep(5000);
}
}
if (running)
@@ -1278,7 +1291,7 @@
} // getBinaryPathName
// ---------------------------------------------------------------
-// Returns the list of NT services being created on the current host.
+// Returns the list of Windows services being created on the current host.
// The function allocates the memory for the returned buffer.
// serviceList contains the list of services.
// nbServices the number of services returned in the list.
--
Gitblit v1.10.0