You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Troy Melhase (JIRA)" <ji...@apache.org> on 2019/04/16 23:27:00 UTC

[jira] [Comment Edited] (NIFI-5556) Expose JVM debugging via command-line argument

    [ https://issues.apache.org/jira/browse/NIFI-5556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16818475#comment-16818475 ] 

Troy Melhase edited comment on NIFI-5556 at 4/16/19 11:26 PM:
--------------------------------------------------------------

Excluding `.bat` files from this change; they seem to already support debugging via setting `%JAVA_OPTS%`.  I'm not certain of this, however.

 

Using this command to determine the shell scripts to consider for this change:

 

```

$ find -name "*.sh"|grep -v ./nifi-assembly/ | grep -v node_mod | xargs grep java | cut -f 1 -d ":" | uniq | sort

```

Produces this list: 

./nifi-docker/dockerhub/sh/start.sh
 ./nifi-docker/dockermaven/sh/start.sh
 ./nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi-env.sh
 ./nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/encrypt-config.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/file-manager.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/flow-analyzer.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/node-manager.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/notify.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/s2s.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/tls-toolkit.sh
 ./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/zk-migrator.sh

 


was (Author: tmelhase):
Using this command to determine the shell scripts to consider for this change:

 

```sh

 find -name "*.sh"|grep -v ./nifi-assembly/ | grep -v node_mod | xargs grep java | cut -f 1 -d ":" | uniq | sort

```

Produces this list:

 

./nifi-docker/dockerhub/sh/start.sh
./nifi-docker/dockermaven/sh/start.sh
./nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi-env.sh
./nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/encrypt-config.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/file-manager.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/flow-analyzer.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/node-manager.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/notify.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/s2s.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/tls-toolkit.sh
./nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/zk-migrator.sh

 

 

> Expose JVM debugging via command-line argument
> ----------------------------------------------
>
>                 Key: NIFI-5556
>                 URL: https://issues.apache.org/jira/browse/NIFI-5556
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Configuration, Tools and Build
>    Affects Versions: 1.7.1
>            Reporter: Andy LoPresto
>            Assignee: Troy Melhase
>            Priority: Major
>              Labels: debug, jvm, toolkit
>
> Recently I have been performing remote JVM debugging on a number of NiFi components -- core instances, TLS toolkit, etc. Currently, to enable/disable JVM debugging requires manually modifying the {{bootstrap.conf}} file or the {{*.sh}} file and (un)commenting/adding the following line(s): 
> *bootstrap.conf*
> {code}
> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
> {code}
> *tls-toolkit.sh*
> {code}
> # exec "${JAVA}" -cp "${CLASSPATH}" ${JAVA_OPTS:--Xms12m -Xmx24m} org.apache.nifi.toolkit.tls.TlsToolkitMain "$@"
>    exec "${JAVA}" -cp "${CLASSPATH}" ${JAVA_OPTS:--Xms12m -Xmx24m} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 org.apache.nifi.toolkit.tls.TlsToolkitMain "$@"
> {code}
> I propose we decide on a standard command-line flag or environment variable which can be set to enable/disable JVM debugging (and optional flag/variable to enable/disable *suspend*) in order to make this easier for developers. 
> My suggestion is to follow a pattern like Kafka uses, as proposed in [this StackOverflow answer|https://stackoverflow.com/a/52021140/70465]. 
> This can be copied to NiFi Registry, MiNiFi Java, etc. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)