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
[WFCORE-5917] Duplicating -Djboss.server.base.dir if defined in more than one place #5110
Conversation
Core - Full Integration Build 11603 outcome was FAILURE using a merge of 53e93cd Failed tests
|
@@ -332,6 +332,10 @@ echo "" | |||
echo "=========================================================================" | |||
echo "" | |||
|
|||
if [[ ! $SERVER_OPTS =~ -Djboss.server.base.dir && ! $JAVA_OPTS =~ -Djboss.server.base.dir ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the shebang is sh
not bash
, so we cannot use some of the enhanced bash features. Even if your current shell allows it, it is not a POXIS standard, for example, it will fail in dash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, I will rework it accordingly, Thanks @yersan
@yersan Updated |
Core -> WildFly Preview Integration Build 11615 outcome was FAILURE using a merge of c146f92 Failed tests
|
Core -> WildFly Preview Integration Build 11618 outcome was FAILURE using a merge of c146f92 |
Core -> WildFly Preview Integration Build 11619 outcome was FAILURE using a merge of c146f92 Failed tests
|
Core -> WildFly Preview Integration Build 11627 outcome was FAILURE using a merge of c146f92 Failed tests
|
Core -> WildFly Preview Integration Build 11630 outcome was FAILURE using a merge of c146f92 Failed tests
|
/retest |
@@ -343,7 +347,6 @@ while true; do | |||
-mp \""${JBOSS_MODULEPATH}"\" \ | |||
org.jboss.as.standalone \ | |||
-Djboss.home.dir=\""$JBOSS_HOME"\" \ | |||
-Djboss.server.base.dir=\""$JBOSS_BASE_DIR"\" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lvydra , I would say this approach has some issues.
At the moment, when the user configures the server config dir by using JAVA_OPTS
, the final value is assigned to the JBOSS_BASE_DIR
, however, with your changes, you are removing this possibility. If the config directory is configured on JAVA_OPTS
and is unavailable on SERVER_OPTS
, the server launch is incorrect. Indeed the JBOSS_BASE_DIR
value is a consolidated one that takes into account other OS, so we need to use this value.
Do you agree?
In general, it doesn't matter if the value is in JAVA_OPTS
, the server code only uses the arguments to the main method, so if we get it duplicated there, it is at first glance, harmless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe you could remove it from the SERVER_OPTS
after being consolidated it on JBOSS_BASE_DIR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yersan, yes I agree, I didn't notice that before. So what if we keep checking, if SERVER_OPTS
contains
-Djboss.server.base.dir
, if so, we will use SERVER_OPTS
as they are, however if not JBOSS_BASE_DIR
will be added to SERVER_OPTS
and that way, the directory configured on JAVA_OPTS
could be eventually passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lvydra , I think we should prefer the one coming from JBOSS_BASE_DIR
instead of the one added at SERVER_OPTS
.
The JBOSS_BASE_DIR
is a consolidated one and looking at the code we have explicitly added computation to consolidate it, e.g symlinks won't be there and it will use the absolute path.
It is a bit weird because having both as server arguments we will get the latest one but that seems unintentional.
About JAVA_OPTS
, it is harmless if it is defined there since the server won't use it. We could remove it from that variable after consolidating the setting on JBOSS_BASE_DIR
, but I think we could keep it there since the argument is the server doesn't use it and we don't want to compromise any possible user application that is dealing with the value by using that property. After all, is a user-defined variable and shown as part of the launch, it will be even weirder to not see it there if you have defined it.
@@ -343,7 +347,6 @@ while true; do | |||
-mp \""${JBOSS_MODULEPATH}"\" \ | |||
org.jboss.as.standalone \ | |||
-Djboss.home.dir=\""$JBOSS_HOME"\" \ | |||
-Djboss.server.base.dir=\""$JBOSS_BASE_DIR"\" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lvydra , I think we should prefer the one coming from JBOSS_BASE_DIR
instead of the one added at SERVER_OPTS
.
The JBOSS_BASE_DIR
is a consolidated one and looking at the code we have explicitly added computation to consolidate it, e.g symlinks won't be there and it will use the absolute path.
It is a bit weird because having both as server arguments we will get the latest one but that seems unintentional.
About JAVA_OPTS
, it is harmless if it is defined there since the server won't use it. We could remove it from that variable after consolidating the setting on JBOSS_BASE_DIR
, but I think we could keep it there since the argument is the server doesn't use it and we don't want to compromise any possible user application that is dealing with the value by using that property. After all, is a user-defined variable and shown as part of the launch, it will be even weirder to not see it there if you have defined it.
Core -> WildFly Preview Integration Build 11667 outcome was FAILURE using a merge of 07840b9 Failed tests
|
Hi @yersan, updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lvydra
https://issues.redhat.com/browse/WFCORE-5917