-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Running plugin with "gradle run --debug-jvm" seems to be broken after version 7.4.x #57860
Comments
I suspect this part of the code might be relevant: elasticsearch/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java Line 461 in bd64da0
Is there any way to turn on more verbose logging to show the exact command being invoked? |
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
Thank you @alexklibisz for reporting. I'll look into this and come back to you in the next couple of days. |
Thanks! 😄 If you have any pointers about where to look, I'm happy to do so as well. I'm not really familiar with the |
Note there's an easier repro. In the elasticsearch repo, running
fails with the same error. |
Good news: The issue seems to be fixed by reverting the changes in this PR: #48188 I'm not sure what that intention of that PR was, but if you revert its changes, the gradle task arrives at the log line Also if you set the debug port to 5000 or 5006 it works.. I guess there's something else running on 5005? I have no clue why it says that it's failing on the elasticsearch/buildSrc/src/minimumRuntime/java/org/elasticsearch/gradle/LoggedExec.java Line 123 in 007ec1f
If I set a break point there, I can manually run the Hopefully that helps a bit. |
@alexklibisz The motivation behind that change is described here: #48188 (comment) So it fails to run as it expects the debug server to be already active. We probably can add a warning when this |
@breskeby Ahh. I see. Yes re-starting the debug server several times used to be annoying. To make sure I understand, the correct debugging workflow is:
I tried that with the rescore plugin and it starts up without issues. And yes it would be very helpful if you could add a warning, especially since the problem seems to manifest via the |
Elasticsearch version: Pertains to 7.4.x and up
Plugins installed: []
JVM version (
java -version
): Pertains to 12 and upOS version (
uname -a
if on a Unix-like system): Ubuntu 19.04, 20.04Description of the problem including expected versus actual behavior:
I'm developing a plugin that started with ES version 7.4.x and I want to update it to use the latest 7.7.x. I found that after bumping from 7.4.2 to 7.5.0 I'm no longer able to debug the plugin using
./gradlew run --debug-jvm
. The regular./gradlew run
still works like normal.Steps to reproduce:
I was able to replicate this with an open source plugin maintained by an elastic employee: https://github.com/spinscale/elasticsearch-ingest-langdetect, which I'll use for my example below.
If you checkout the commit that updates to 7.4.2, you'll find you can run
./gradlew run --debug-jvm
without issue.This eventually prints "Running elasticsearch in debug mode, suspending until connected on port 8000" and you can connect from an IDE. So it works.
Then if you checkout the next commit that updates to 7.5.0, and run with
--stacktrace
, you get an error.This eventually prints a large stacktrace, summarized below:
I also tried this with the subsequent 7.6.x and 7.7.x updates and it produces the same errors.
Note that both 7.4.2 and 7.5.0 are running on JDK 12. So it doesn't seem to be a JDK bug.
I'm using OpenJDK 12.0.2 in the above example.
Provide logs (if relevant):
Here is the full log: https://pastebin.com/6RctUHpL
The text was updated successfully, but these errors were encountered: