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

[WFCORE-6202] Don't set -server option for IBM i #5355

Merged
merged 1 commit into from Mar 6, 2023
Merged

Conversation

ThePrez
Copy link
Contributor

@ThePrez ThePrez commented Jan 19, 2023

Addresses WFCORE-6202

@wildfly-ci
Copy link

Hello, ThePrez. I'm waiting for one of the admins to verify this patch with /ok-to-test in a comment.

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Jan 20, 2023
@bstansberry
Copy link
Contributor

/ok-to-test

@bstansberry
Copy link
Contributor

Hi @ThePrez -- I wonder if we can just drop that setting altogether. See discussion at https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/topic/JVM.20-server.20option

@ThePrez
Copy link
Contributor Author

ThePrez commented Jan 25, 2023

@bstansberry, given the Zulip discussion, I cleaned this up to just get rid of the -server/-client logic altogether.

Copy link
Collaborator

@yersan yersan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ThePrez , LGTM, added a minor comment, but that's optional in my opinion.

@jamezp Would you mind approving this as well?

We still have logic regarding "-client" option on the windows and PowerShell variants, but those are not relevant to fix the issue with the IBM I and I haven't spotted any problems with those scripts. Domain mode scripts don't use the "-client" option.

jamezp
jamezp previously approved these changes Jan 30, 2023
Copy link
Member

@jamezp jamezp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems okay to me as well. I do wonder if we should update the other scripts, e.g. standalone.bat, as well. But as @yersan said, that doesn't really have anything to do with this specific issue.

@ThePrez
Copy link
Contributor Author

ThePrez commented Jan 31, 2023

Removed -server logic from standalone.bat and domain.sh and performed basic tests from Windows and IBM i, respectively

@wildfly-ci
Copy link

Core -> Full Integration Build 12175 outcome was UNKNOWN using a merge of 2e52474
Summary: Canceled (Error while applying patch; cannot find commit 48abc7d in the https://github.com/wildfly/wildfly-core.git repository, possible reason: refs/pull/5355/merge branch was updated and the commit selected for the ... Build time: 00:00:14

@wildfly-ci
Copy link

Core -> WildFly Preview Integration Build 12104 outcome was UNKNOWN using a merge of 2e52474
Summary: Canceled (Error while applying patch; cannot find commit 48abc7d in the https://github.com/wildfly/wildfly-core.git repository, possible reason: refs/pull/5355/merge branch was updated and the commit selected for the ... Build time: 00:00:16

@wildfly-ci
Copy link

Core -> Full Integration Build 11981 outcome was UNKNOWN using a merge of 2e52474
Summary: Canceled (Error while applying patch; cannot find commit 48abc7d in the https://github.com/wildfly/wildfly-core.git repository, possible reason: refs/pull/5355/merge branch was updated and the commit selected for the ... Build time: 00:00:16

Comment on lines -108 to -139
# If -server not set in JAVA_OPTS, set it, if supported
SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
if [ "x$SERVER_SET" = "x" ]; then

# Check for SUN(tm) JVM w/ HotSpot support
if [ "x$HAS_HOTSPOT" = "x" ]; then
HAS_HOTSPOT=`"$JAVA" $JVM_OPTVERSION -version 2>&1 | $GREP -i HotSpot`
fi

# Check for OpenJDK JVM w/server support
if [ "x$HAS_OPENJDK" = "x" ]; then
HAS_OPENJDK=`"$JAVA" $JVM_OPTVERSION 2>&1 | $GREP -i OpenJDK`
fi

# Check for IBM JVM w/server support
if [ "x$HAS_IBM" = "x" ]; then
HAS_IBM=`"$JAVA" $JVM_OPTVERSION 2>&1 | $GREP -i "IBM J9"`
fi

# Enable -server if we have Hotspot or OpenJDK, unless we can't
if [ "x$HAS_HOTSPOT" != "x" -o "x$HAS_OPENJDK" != "x" -o "x$HAS_IBM" != "x" ]; then
# MacOS does not support -server flag
if [ "$darwin" != "true" ]; then
PROCESS_CONTROLLER_JAVA_OPTS="-server $PROCESS_CONTROLLER_JAVA_OPTS"
HOST_CONTROLLER_JAVA_OPTS="-server $HOST_CONTROLLER_JAVA_OPTS"
JVM_OPTVERSION="-server $JVM_OPTVERSION"
fi
fi
else
JVM_OPTVERSION="-server $JVM_OPTVERSION"
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is harmless, the code is prepared to add the "-server" setting automatically if it is supported. The same is applicable to the standalone.bat with -client and -server.

@ThePrez I could be missing something, what's the reason for the removal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code in domain.sh also breaks with system Java on IBM i (domain mode is likely very uncommon on IBM i so I didn't do proper testing with it).

Rather than cleaning it up so it works, removal seemed to make the most sense, given the comments on Zulip. The -server option has lost its relevancy over time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I thought it was not going to fail since the above code only will add the "-server" option for HotSpot/OpenJDK and IBM J9, but I have no experience with the JVMs in an IBM i, and I'm not sure now what it version returns.

In any case, you're right, yes, the idea was to get rid of these options. In such a case, would you mind expanding the removal starting from L101? We can also get rid of the JVM_OPTVERSION, JVM_D64_OPTION, and JVM_D32_OPTION variables.

We should also clean up the same on domain.bat variant so both are in sync regarding this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yersan , I am very sorry. 10 demerits for me. I flat-out forgot to commit the domain.bat cleanup. 👎 Now in at e745fb9

I have expanded the removal to start at L101 at f1d083b

I've also cleaned up the .ps1's and committed those changes as well (with some basic startup testing), at 433fc5b

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I thought it was not going to fail since the above code only will add the "-server" option for HotSpot/OpenJDK and IBM J9

FWIW, System Java on this platform is IBM J9, but not all flavors of IBM J9 support -server 😖

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought we were going to have a different version, then removing that completely is safest for being able to use it on IBM i.

@wildfly wildfly deleted a comment from wildfly-ci Feb 1, 2023
@wildfly wildfly deleted a comment from wildfly-ci Feb 1, 2023
Comment on lines -108 to -139
# If -server not set in JAVA_OPTS, set it, if supported
SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
if [ "x$SERVER_SET" = "x" ]; then

# Check for SUN(tm) JVM w/ HotSpot support
if [ "x$HAS_HOTSPOT" = "x" ]; then
HAS_HOTSPOT=`"$JAVA" $JVM_OPTVERSION -version 2>&1 | $GREP -i HotSpot`
fi

# Check for OpenJDK JVM w/server support
if [ "x$HAS_OPENJDK" = "x" ]; then
HAS_OPENJDK=`"$JAVA" $JVM_OPTVERSION 2>&1 | $GREP -i OpenJDK`
fi

# Check for IBM JVM w/server support
if [ "x$HAS_IBM" = "x" ]; then
HAS_IBM=`"$JAVA" $JVM_OPTVERSION 2>&1 | $GREP -i "IBM J9"`
fi

# Enable -server if we have Hotspot or OpenJDK, unless we can't
if [ "x$HAS_HOTSPOT" != "x" -o "x$HAS_OPENJDK" != "x" -o "x$HAS_IBM" != "x" ]; then
# MacOS does not support -server flag
if [ "$darwin" != "true" ]; then
PROCESS_CONTROLLER_JAVA_OPTS="-server $PROCESS_CONTROLLER_JAVA_OPTS"
HOST_CONTROLLER_JAVA_OPTS="-server $HOST_CONTROLLER_JAVA_OPTS"
JVM_OPTVERSION="-server $JVM_OPTVERSION"
fi
fi
else
JVM_OPTVERSION="-server $JVM_OPTVERSION"
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I thought it was not going to fail since the above code only will add the "-server" option for HotSpot/OpenJDK and IBM J9, but I have no experience with the JVMs in an IBM i, and I'm not sure now what it version returns.

In any case, you're right, yes, the idea was to get rid of these options. In such a case, would you mind expanding the removal starting from L101? We can also get rid of the JVM_OPTVERSION, JVM_D64_OPTION, and JVM_D32_OPTION variables.

We should also clean up the same on domain.bat variant so both are in sync regarding this.

@ThePrez
Copy link
Contributor Author

ThePrez commented Feb 3, 2023

The -server logic should be completely removed now, except this blurb that remains in standalone.sh

    # Check for -d32/-d64 in JAVA_OPTS
    JVM_D64_OPTION=`echo $JAVA_OPTS | $GREP "\-d64"`
    JVM_D32_OPTION=`echo $JAVA_OPTS | $GREP "\-d32"`

    # Check If -server is specified
    SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`

    if [ "x$JVM_D32_OPTION" != "x" ]; then
        JVM_OPTVERSION="-d32"
    elif [ "x$JVM_D64_OPTION" != "x" ]; then
        JVM_OPTVERSION="-d64"
    elif $darwin && [ "x$SERVER_SET" = "x" ]; then
        # Use 32-bit on Mac, unless server has been specified or the user opts are incompatible
        "$JAVA" -d32 $JAVA_OPTS -version > /dev/null 2>&1 && PREPEND_JAVA_OPTS="-d32" && JVM_OPTVERSION="-d32"
    fi

Seems unnecessary and dated, but harmless. Opinions?

@wildfly wildfly deleted a comment from wildfly-ci Feb 13, 2023
@yersan
Copy link
Collaborator

yersan commented Feb 13, 2023

The -server logic should be completely removed now, except this blurb that remains in standalone.sh

@ThePrez apologies for the delay in giving a response. The -d32/64 options look outdated and my understanding is they are only valid for systems where you can have a 32/64 JDK installed at the same time and you want to choose the bit mode. This seems only possible on Solaris. I think we can safely remove this check, even more nowadays where WildFly's minimal JDK version is JDK 11.

@yersan
Copy link
Collaborator

yersan commented Feb 14, 2023

@ThePrez I forgot to mention that we need to squash the commits, that help us to move the change across other branches. Thanks!

@ThePrez
Copy link
Contributor Author

ThePrez commented Feb 15, 2023

The -server logic should be completely removed now, except this blurb that remains in standalone.sh

@ThePrez apologies for the delay in giving a response. The -d32/64 options look outdated and my understanding is they are only valid for systems where you can have a 32/64 JDK installed at the same time and you want to choose the bit mode. This seems only possible on Solaris. I think we can safely remove this check, even more nowadays where WildFly's minimal JDK version is JDK 11.

I agree. Removed at latest commit

@ThePrez
Copy link
Contributor Author

ThePrez commented Feb 15, 2023

@ThePrez I forgot to mention that we need to squash the commits, that help us to move the change across other branches. Thanks!

No problem. Squashed!

@wildfly-ci
Copy link

Core -> Full Integration Build 12203 outcome was FAILURE using a merge of 714932b
Summary: Tests failed: 1 (1 new), passed: 7245, ignored: 130 Build time: 04:15:34

Failed tests

org.wildfly.extension.batch.jberet.JBeretSubsystemParsingTestCase.testRejectingTransformersEAP74: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.wildfly.core:wildfly-threads:jar:15.0.2.Final-redhat-00001 from/to repo0 (http://nexus.wildfly.int/nexus/repository/public/): Connect to nexus.wildfly.int:80 timed out
	at org.jboss.as.model.test.MavenUtil.createMavenGavURL(MavenUtil.java:142)
	at org.jboss.as.model.test.ChildFirstClassLoaderBuilder.addMavenResourceURL(ChildFirstClassLoaderBuilder.java:198)
	at org.jboss.as.subsystem.test.SubsystemTestDelegate$LegacyKernelServiceInitializerImpl.addMavenResourceURL(SubsystemTestDelegate.java:712)
	at org.wildfly.extension.batch.jberet.JBeretSubsystemParsingTestCase.testRejectingTransformers(JBeretSubsystemParsingTestCase.java:187)
	at org.wildfly.extension.batch.jberet.JBeretSubsystemParsingTestCase.testRejectingTransformersEAP74(JBeretSubsystemParsingTestCase.java:179)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.wildfly.core:wildfly-threads:jar:15.0.2.Final-redhat-00001 from/to repo0 (http://nexus.wildfly.int/nexus/repository/public/): Connect to nexus.wildfly.int:80 timed out
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:260)
	at org.jboss.as.model.test.MavenUtil.createMavenGavURL(MavenUtil.java:140)
	... 34 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.wildfly.core:wildfly-threads:jar:15.0.2.Final-redhat-00001 from/to repo0 (http://nexus.wildfly.int/nexus/repository/public/): Connect to nexus.wildfly.int:80 timed out
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:365)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
	... 38 more
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to nexus.wildfly.int:80 timed out
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:164)
	at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:296)
	at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:252)
	at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:67)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:453)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
	... 43 more


Copy link
Collaborator

@yersan yersan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ThePrez, I've added one last comment related to your last modification but looks good to me.

@jamezp another two eyes are welcome, those scripts are always a bit tricky, could you also review them?

@yersan yersan dismissed jamezp’s stale review February 22, 2023 11:13

There were additional changes after this review, I will ask for another one on James side.

Copy link
Collaborator

@yersan yersan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThePrez, Thank you!, LGTM

@yersan yersan requested a review from jamezp February 22, 2023 11:16
@yersan
Copy link
Collaborator

yersan commented Mar 3, 2023

@jamezp , when you have a chance, would you mind reviewing this one?

Copy link
Member

@jamezp jamezp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this seems fine. If a user wants to use -server it's very easy for them to just place it in their JAVA_OPTS in one of the standalon.conf.* files.

Side note; as a former IBM i developer I'm very happy to see WildFly running on the IBM i :)

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Mar 6, 2023
@yersan yersan merged commit e19550d into wildfly:main Mar 6, 2023
@yersan
Copy link
Collaborator

yersan commented Mar 6, 2023

@ThePrez , merged. Thank you for contributing to WildFly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
5 participants