Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-3473 Make initial wait time configurable with default value of… #3761

Merged
merged 3 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public enum RUNTIME_OPTION {
enablesni(false),
hzpublicaddress(true),
shutdowngrace(true, new IntegerValidator(1, Integer.MAX_VALUE)),
hzinitialjoinwait(true, new IntegerValidator(0,100000)),
contextroot(true);

private RUNTIME_OPTION(boolean hasValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public class PayaraMicroImpl implements PayaraMicroBoot {
private boolean showServletMappings;
private boolean sniEnabled = false;
private String publicAddress = "";
private int initialJoinWait = 1;

/**
* Runs a Payara Micro server used via java -jar payara-micro.jar
Expand Down Expand Up @@ -1357,6 +1358,9 @@ else if (requestTracing[0].matches("\\D+")) {
case shutdowngrace:
System.setProperty(GlassFishImpl.PAYARA_SHUTDOWNGRACE_PROPERTY, value);
break;
case hzinitialjoinwait:
initialJoinWait = Integer.parseInt(value);
break;
case contextroot:
if (contextRoot != null) {
LOGGER.warning("Multiple --contextroot arguments only the last one will apply");
Expand Down Expand Up @@ -1838,8 +1842,14 @@ private void configurePhoneHome() {
}
}


private void configureHazelcast() {
// check hazelcast cluster overrides
// set join wait based on the command flag
if (System.getProperty("hazelcast.wait.seconds.before.join") == null) {
System.setProperty("hazelcast.wait.seconds.before.join", Integer.toString(initialJoinWait));
}

if (noCluster) {
preBootCommands.add(new BootCommand("set", "configs.config.server-config.hazelcast-config-specific-configuration.enabled=false"));
preBootCommands.add(new BootCommand("set", "configs.config.server-config.ejb-container.ejb-timer-service.ejb-timer-service=Dummy"));
Expand Down Expand Up @@ -2118,6 +2128,7 @@ private void setArgumentsFromSystemProperties() {

autoBindHttp = getBooleanProperty("payaramicro.autoBindHttp");
autoBindRange = getIntegerProperty("payaramicro.autoBindRange", 5);
initialJoinWait = getIntegerProperty("payaramicro.initialJoinWait",1);
autoBindSsl = getBooleanProperty("payaramicro.autoBindSsl");
generateLogo = getBooleanProperty("payaramicro.logo");
logToFile = getBooleanProperty("payaramicro.logToFile");
Expand Down Expand Up @@ -2314,6 +2325,7 @@ private void packageUberJar() {
props.setProperty("payaramicro.disablePhoneHome", Boolean.toString(disablePhoneHome));
props.setProperty("payaramicro.showServletMappings", Boolean.toString(showServletMappings));
props.setProperty("payaramicro.sniEnabled", Boolean.toString(sniEnabled));
props.setProperty("payaramicro.initialJoinWait", Integer.toString(initialJoinWait));

if (publicAddress != null) {
props.setProperty("payaramicro.publicAddress", publicAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ interfaces=Specifies the Interfaces that the data grid discovery mode should use
secretsdir=Directory to read secrets files using the Microprofile config api.
showservletmappings=Shows the servlet mappings in the deployment summary message.
hzpublicaddress=Sets the Public Address of the Data Grid for use where NAT translation is used (including in Docker)
hzinitialjoinwait=Set the join wait system property hazelcast.wait.seconds.before.join which is the wait time before joining the cluster
contextroot=Specifies the context root of the first deployment without a context root specified