NIFI-6764: Recreate GroovyShell in ExecuteGroovyScript only when necessary

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #3803.
This commit is contained in:
Matthew Burgess 2019-10-09 20:45:51 -04:00 committed by Pierre Villard
parent 266a59d05a
commit 77e9bda0ff
No known key found for this signature in database
GPG Key ID: BEE1599F0726E9CD
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}