markap14 commented on a change in pull request #4903:
URL: https://github.com/apache/nifi/pull/4903#discussion_r601827461



##########
File path: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/script/impl/JythonScriptEngineConfigurator.java
##########
@@ -50,7 +50,7 @@ public String getScriptEngineName() {
     @Override
     public Object init(ScriptEngine engine, String scriptBody, String[] 
modulePaths) throws ScriptException {
         // Always compile when first run
-        if (engine != null && compiledScriptRef.get() == null) {

Review comment:
       So this change would address the issue at hand, I believe, but it would 
do so at the expense of requiring that ExecuteScript would have to recompile 
the Jython script for every invocation of `onTrigger`. That could result in 
some extremely poor performance. I think we should instead leave this check in, 
but add an onPropertyModified method for the script components that is 
responsible for resetting the state here. So that way, we only need to 
recompile if a property is changed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to