Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit 665bccd

Browse files
jmazzitelliLibor Zoubek
authored andcommitted
BZ 1160851 - add the ability to wait for N seconds while testing for the server to come up. Default is 60s, but there is now a backdoor sysprop you can set if you want it to be longer or shorter.
(cherry picked from commit 8e91dec) Signed-off-by: Libor Zoubek <lzoubek@redhat.com>
1 parent 78a4c7b commit 665bccd

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ public class InstallerServiceImpl implements InstallerService {
7777
private static final String SYSPROP_PROPFILE = "rhq.server.properties-file";
7878
private static final String SYSPROP_BASEDIR = "rhq.server.basedir";
7979

80+
private static final String SYSPROP_TEST_CONTROLLER_TIMEOUT = "rhq.test.controller.timeout";
81+
private static final int TEST_CONTROLLER_TIMEOUT_SECS;
82+
static {
83+
int secs = 60;
84+
try {
85+
secs = Integer.parseInt(System.getProperty(SYSPROP_TEST_CONTROLLER_TIMEOUT, String.valueOf(secs)));
86+
} catch (Throwable t) {
87+
// ignore
88+
}
89+
TEST_CONTROLLER_TIMEOUT_SECS = secs;
90+
}
91+
8092
private final Log log = LogFactory.getLog(InstallerServiceImpl.class);
8193
private final InstallerConfiguration installerConfiguration;
8294

@@ -317,7 +329,7 @@ public HashMap<String, String> preInstall() throws AutoInstallDisabledException,
317329
}
318330

319331
// make an attempt to connect to the app server - we must make sure its running and we can connect to it
320-
final String asVersion = testModelControllerClient(serverProperties);
332+
final String asVersion = testModelControllerClient(serverProperties, TEST_CONTROLLER_TIMEOUT_SECS);
321333
log("Installing into app server version [" + asVersion + "]");
322334

323335
// If we are already fully installed, we don't have to do anything. Just return false immediately.
@@ -463,7 +475,7 @@ public void install(HashMap<String, String> serverProperties, ServerDetails serv
463475
reloadConfiguration();
464476

465477
// we need to wait for the reload to finish - wait until we can connect again
466-
testModelControllerClient(60);
478+
testModelControllerClient(TEST_CONTROLLER_TIMEOUT_SECS);
467479

468480
// deploy the main EAR app subsystem - this is the thing that contains and actually deploys the EAR
469481
deployAppSubsystem();

0 commit comments

Comments
 (0)