This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 77e9bda  NIFI-6764: Recreate GroovyShell in ExecuteGroovyScript only 
when necessary
77e9bda is described below

commit 77e9bda0fff8166e21d237f9f92e5ef6348799ac
Author: Matthew Burgess <[email protected]>
AuthorDate: Wed Oct 9 20:45:51 2019 -0400

    NIFI-6764: Recreate GroovyShell in ExecuteGroovyScript only when necessary
    
    Signed-off-by: Pierre Villard <[email protected]>
    
    This closes #3803.
---
 .../java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
 
b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
index c35ab39..f67df2b 100644
--- 
a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
+++ 
b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
@@ -233,7 +233,10 @@ public class ExecuteGroovyScript extends AbstractProcessor 
{
      */
     @Override
     public void onPropertyModified(final PropertyDescriptor descriptor, final 
String oldValue, final String newValue) {
-        this.shell = null;
+        // Only re-create the shell if necessary, this helps if loading native 
libraries
+        if (ExecuteGroovyScript.ADD_CLASSPATH.equals(descriptor)) {
+            this.shell = null;
+        }
         this.compiled = null;
         this.scriptLastModified = 0;
     }

Reply via email to