Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5556

Expose JVM debugging via command-line argument

    XMLWordPrintableJSON

    Details

      Description

      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

      java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
      

      tls-toolkit.sh

      # 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 "$@"
      

      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.

      This can be copied to NiFi Registry, MiNiFi Java, etc.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmelhase Troy Melhase
                Reporter:
                alopresto Andy LoPresto
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m