Skip to content

Commit

Permalink
Add option to control exposer of debug ports
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Dec 20, 2023
1 parent 3243142 commit 554226d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ public static boolean start( final ClientCommunicationStream clientCommunication
String logsDir = configuration.getString( "pcrtl.logsdir" );
String javaExecutable = configuration.getString( "pcrtl.java.executable" ) + (SystemUtils.IS_OS_WINDOWS ? ".exe" : "");
List<String> javaOptions = configuration.getStringList( "pcrtl.java.options" );
boolean exposeJavaDebug = configuration.getBoolean( "pcrtl.java.debug.expose" );
List<String> javaDebugOptions = configuration.getStringList( "pcrtl.java.debug.options" );
String javaMaximumHeapSize = configuration.getString( "pcrtl.java.heap" );
String pdbmsJar = configuration.getString( "pcrtl.pdbms.jarfile" );
String pdbmsMainClass = configuration.getString( "pcrtl.pdbms.mainclass" );
Expand All @@ -185,6 +187,11 @@ public static boolean start( final ClientCommunicationStream clientCommunication
}*/
javaOptionsFull.addFirst( "-Xmx" + javaMaximumHeapSize + "G" );

// Expose Debug
if ( exposeJavaDebug ) {
javaOptionsFull.addAll( javaDebugOptions );
}

// Build list of arguments
List<String> pdbArguments = new LinkedList<>();
if ( !pdbmsArgs.trim().isEmpty() ) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ pcrtl {

java.executable = ${java.home}${file.separator}bin${file.separator}java
java.options = [
"-Djava.net.preferIPv4Stack=true",
]
java.heap = 4

java.debug.expose = false
java.debug.options = [
"-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n",
"-Dcom.sun.management.jmxremote",
"-Dcom.sun.management.jmxremote.ssl=false",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.port=8001",
"-Djava.net.preferIPv4Stack=true",
]
java.heap = 4

pdbms.pidfile = ${pcrtl.workingdir}${file.separator}polypheny-db.pid
pdbms.jarfilename = "polypheny-db.jar"
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ <h1>Settings</h1>
</select>
</td>
</tr>
<tr>
<td>Expose Java Debug (JDWP & JMX)</td>
<td>
<select name="pcrtl.java.debug.expose">
<option value="false">No</option>
<option value="true">Yes</option>
</select>
</td>
</tr>
<tr>
<td>Maximum Java Heap Size (in Gigabyte)</td>
<td><input name="pcrtl.java.heap" value="10" type="number"></td>
Expand Down

0 comments on commit 554226d

Please sign in to comment.