markap14 commented on code in PR #11574:
URL: https://github.com/apache/nifi/pull/11574#discussion_r3831536048


##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java:
##########
@@ -2082,6 +2082,11 @@ public String invokeConnectorMethod(final String 
methodName, final Map<String, S
             } catch (final Exception e) {
                 throw new InvocationFailedException(e);
             }
+        } catch (final LinkageError e) {
+            // Argument types, return types, and the invoked method body can 
all reference classes supplied by additional classpath
+            // resources. Those failures are LinkageError, not Exception, so 
they would otherwise escape as an uncaught Error.
+            throw new InvocationFailedException("Failed to invoke Connector 
Method '" + methodName + "' on " + this
+                + " because a class required by the component could not be 
loaded from the component's ClassLoader", e);

Review Comment:
   @sfc-gh-bbende Agreed. Addressed in f6be5026c9f: the outer catch is now 
`TypeNotPresentException | LinkageError`, and the comment describes the 
remaining paths (`MethodArgument.type()`, implementation Method parameter 
types, vs discovery wrapping `LinkageError` and method-body Errors arriving as 
`InvocationTargetException`). The same change is on 
`StandardControllerServiceNode`.



##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/facades/standalone/StandaloneParameterContextFacade.java:
##########
@@ -95,8 +95,14 @@ public void updateParameters(final 
Collection<ParameterValue> updatedValues) {
         final Map<String, Parameter> updatedParameters = 
createParameterMap(updatedValues);
         
managedProcessGroup.getParameterContext().setParameters(updatedParameters);
 
-        allReferencingProcessors.forEach(ProcessorNode::resetValidationState);
+        // A component whose additional classpath resources are supplied by a 
Parameter must be reloaded so that its ClassLoader reflects the
+        // updated Parameter values. Components that are not running are not 
restarted below, so reloading here is the only point at which their
+        // ClassLoader is rebuilt.
+        
allReferencingServices.forEach(ControllerServiceNode::reloadAdditionalResourcesIfNecessary);
+        
allReferencingProcessors.forEach(ProcessorNode::reloadAdditionalResourcesIfNecessary);

Review Comment:
   @sfc-gh-bbende Also addressed in f6be5026c9f. After reloading each service 
in `allReferencingServices`, we now call 
`findRecursiveReferences(ComponentNode.class)` and reload those components, 
matching `StandardControllerServiceNode.setProperties()`. Covered by 
`StandaloneParameterContextFacadeTest`.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to