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

Recreate GroovyShell in ExecuteGroovyScript only when necessary

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0
    • Component/s: Extensions
    • Labels:
      None

      Description

      Currently, if any property is modified in ExecuteGroovyScript, the shell is abandoned and a new one will be created. This can cause problems when using a third-party JAR that loads a native library, as the class that loads the library will be garbage-collected but will still exist in the JVM's native library registry. If the processor is stopped and a property modified, the native library will fail to be reloaded, with the error that it has already been loaded by another classloader.

      The shell need not be abandoned unless something changes in the classpath, which can happen if the "Additional classpath" property is changed. Otherwise the shell should remain intact, so it can be reused to evaluate scripts and thus allow access to the native library. Note that if the "Additional classpath" property is changed and a native library is to be loaded, the same error will occur, and NiFi needs to be restarted in this case. This Jira is to enable the user to change something like the Script Body (which ostensibly calls something to load the native library) without having to restart NiFi each time.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mattyb149 Matt Burgess
                Reporter:
                mattyb149 Matt Burgess
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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