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

Dev mode hangs when debugging Gradle plugin execution due to debug port collision across parent/child Gradle processes. #801

Closed
scottkurz opened this issue Mar 10, 2023 · 1 comment · Fixed by #802

Comments

@scottkurz
Copy link
Member

A simple: gradle libertyDev -Dorg.gradle.debug=true will typically hang.

The reason is that the JVM debug args will be constructed as: ...,suspend=y,address=5005 for the process running DevTask.

However, the child Gradle launched via BuildLauncher in DevTask:runGradleTask() will likewise be configured with the same exact JVM args. Because the daemon running the parent task is in-use, a new JVM/daemon will be needed. So the parent Gradle execution DevTask will hang waiting for the child, while it waits for a debugger connection.

Maybe we'd need to loop in the findAvailablePort processing to make this work.

Tried w/ LGP v3.5.2 but I think any recent version with dev mode would have this issue.

@scottkurz
Copy link
Member Author

scottkurz commented Mar 10, 2023

From above I had in mind the org.gradle.debug.port property, however it seems relatively recent. I see it added in https://docs.gradle.org/7.4/userguide/troubleshooting.html, but not the 7.3 doc. I'd imagine we could construct the JVM args: e.g. -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5009 more manually ourselves in LGP code if we really wanted to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant