Skip to content

Commit 40c717b

Browse files
committed
Switch to debug with server=n (#48188)
Before this change one needed to re-start debugging several times, as we launched multiple JVMs in debug mode. With this option the IDE has the option to re-launch and listen for connections again leading for to a more pleasant experience.
1 parent e303683 commit 40c717b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

TESTING.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ supports a remote debugging option:
4343
./gradlew run --debug-jvm
4444
---------------------------------------------------------------------------
4545

46+
This will instruct all JVMs (including any that run cli tools such as creating the keyring or adding users)
47+
to suspend and initiate a debug connection on port incrementing from 5005.
48+
As such the IDE needs to be instructed to listen for connections on this port.
49+
Since we might run multiple JVMs as part of configuring and starting the cluster it's
50+
recommended to have the option to aut restart checked.
51+
4652
==== Distribution
4753

4854
By default a node is started with the zip distribution.

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public Boolean getDebug() {
3636

3737
@Override
3838
public void beforeStart() {
39-
int debugPort = 8000;
39+
int debugPort = 5005;
4040
int httpPort = 9200;
4141
int transportPort = 9300;
4242
Map<String, String> additionalSettings = System.getProperties().entrySet().stream()
@@ -57,7 +57,7 @@ public void beforeStart() {
5757
"Running elasticsearch in debug mode, {} suspending until connected on debugPort {}",
5858
node, debugPort
5959
);
60-
node.jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=" + debugPort);
60+
node.jvmArgs("-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=" + debugPort);
6161
debugPort += 1;
6262
}
6363
}

0 commit comments

Comments
 (0)