Matt Burgess created NIFI-7404:
----------------------------------

             Summary: Scripted processors become invalid when thread terminated
                 Key: NIFI-7404
                 URL: https://issues.apache.org/jira/browse/NIFI-7404
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
            Reporter: Matt Burgess


As reported on the NiFi users mailing list, when a processor thread is 
terminated for ExecuteScript or InvokeScriptedProcessor, the processor becomes 
invalid with the message "‘Script engine’ validated against ‘<script engine 
name>’ is invalid because Given value not found in allowed set ‘ECMA Script’".

This is caused by the scriptingComponentHelper not being re-initialized 
correctly. When createResources() is called, it is called from a thread whose 
context classloader is not the processor's instance classloader, and thus none 
of the additional script engines are found.

This could be fixed by NIFI-6386, but specifically for these processors there 
is another solution, namely to add an OnAdded method that calls 
createResources() whether some other thread has already called it. The OnAdded 
method is guaranteed to be called with the thread's context class loader set to 
the processor's instance classloader, and will set the initialized flag to 
true, preventing any future calls (of other methods) of createResources() if 
not initialized.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to