From 77e9bda0fff8166e21d237f9f92e5ef6348799ac Mon Sep 17 00:00:00 2001 From: Matthew Burgess Date: Wed, 9 Oct 2019 20:45:51 -0400 Subject: [PATCH] NIFI-6764: Recreate GroovyShell in ExecuteGroovyScript only when necessary Signed-off-by: Pierre Villard This closes #3803. --- .../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 c35ab392d6..f67df2b3ad 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; }