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

Fix quarkus.native.debug-build-process #20451

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Sep 29, 2021

As of JDK 9 address needs to specify the host as well. This patch
makes JDWP listen on 0.0.0.0 and is compatible with JDK 8 and JDK >= 9

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

Perhaps this should take the "runs-in-container" property into account? I'd think for local debugging this isn't needed and it would only be exposing more than necessary. Thoughts?

@zakkak
Copy link
Contributor Author

zakkak commented Sep 29, 2021

Perhaps this should take the "runs-in-container" property into account? I'd think for local debugging this isn't needed and it would only be exposing more than necessary. Thoughts?

@jerboaa You mean that we should be using localhost when not running in a container and only use 0.0.0.0 when in a container, right?

@jerboaa
Copy link
Contributor

jerboaa commented Sep 29, 2021

@jerboaa You mean that we should be using localhost when not running in a container and only use 0.0.0.0 when in a container, right?

Yes. Use the old code to only bind to a specific port locally when not in a container and change to the new 0.0.0.0 address when we are building in a container.

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 29, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 747fcce

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: integration-tests/container-image/maven-invoker-way 

📦 integration-tests/container-image/maven-invoker-way

Failed to execute goal org.apache.maven.plugins:maven-invoker-plugin:3.2.2:run (integration-tests) on project quarkus-integration-test-container-image-invoker: 1 build failed. See console output above for details.

📦 integration-tests/container-image/maven-invoker-way/target/it/container-build-jib-with-mongo

org.acme.FruitsEndpointTest.testListAllFruits - More details - Source on GitHub

java.lang.RuntimeException: 
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.mongodb.deployment.DevServicesMongoProcessor#startMongo threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/smallrye-reactive-messaging-kafka/deployment integration-tests/container-image/maven-invoker-way 
! Skipped: docs integration-tests/kafka-sasl-elytron integration-tests/kubernetes/quarkus-standard-way-kafka and 2 more

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream - More details - Source on GitHub

java.lang.RuntimeException: 
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor#startKafkaDevService threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed

📦 integration-tests/container-image/maven-invoker-way

Failed to execute goal org.apache.maven.plugins:maven-invoker-plugin:3.2.2:run (integration-tests) on project quarkus-integration-test-container-image-invoker: 1 build failed. See console output above for details.

📦 integration-tests/container-image/maven-invoker-way/target/it/container-build-jib-with-mongo

org.acme.FruitsEndpointTest.testListAllFruits - More details - Source on GitHub

java.lang.RuntimeException: 
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.mongodb.deployment.DevServicesMongoProcessor#startMongo threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

Perhaps we could avoid the localhost part? See below.

@@ -620,8 +620,15 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
}
if (nativeConfig.debugBuildProcess) {
String debugBuildProcessHost;
if (isContainerBuild) {
debugBuildProcessHost = "0.0.0.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

How about?

String debugAgentAddress = DEBUG_BUILD_PROCESS_PORT;
if (isContainerBuild) {
   debugAgentAddress = "0.0.0.0:" + DEBUG_BUILD_PROCESS_PORT;
}
[...]
.add("-J-Xrunjdwp:transport=dt_socket,address=" + debugAgentAddress + ",server=y,suspend=y");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We sure can, but what's the benefit of it?
This way we make clear that we only want the process to listen on localhost when building locally, do you forsee any issues with this?

Copy link
Contributor

Choose a reason for hiding this comment

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

No it would just be the more backward compatible way, I guess. Looking at the JDK 11 address parsing code "localhost" is handled fine, so feel free to ignore it.

@zakkak zakkak requested a review from geoand October 1, 2021 11:58
As of JDK 9 `address` needs to specify the host as well. This patch
makes JDWP listen on 0.0.0.0 and is compatible with JDK 8 and JDK >= 9
@zakkak zakkak force-pushed the fix-debug-build-process branch from 747fcce to 56fb882 Compare October 5, 2021 09:09
@zakkak zakkak added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 5, 2021
@geoand geoand merged commit 99a4d06 into quarkusio:main Oct 7, 2021
@quarkus-bot quarkus-bot bot added this to the 2.4 - main milestone Oct 7, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 7, 2021
@geoand geoand added triage/backport? triage/waiting-for-ci Ready to merge when CI successfully finishes labels Oct 7, 2021
@gsmet gsmet modified the milestones: 2.4.0.CR1, 2.3.1.Final Oct 18, 2021
@gsmet gsmet modified the milestones: 2.3.1.Final, 2.2.4.Final Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants