mcgilman commented on code in PR #11677:
URL: https://github.com/apache/nifi/pull/11677#discussion_r4329567828


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java:
##########
@@ -487,16 +487,20 @@ private Map<String, StepConfiguration> 
migrateProperties(final List<VersionedCon
             initial.put(versionedConfigStep.getName(), new 
StepConfiguration(toValueReferenceMap(versionedConfigStep)));
         }
 
+        return migrateProperties(getConnector(), initial);
+    }
+
+    private Map<String, StepConfiguration> migrateProperties(final Connector 
connector, final Map<String, StepConfiguration> initial) {
         final Set<String> persistedStepNames = new 
LinkedHashSet<>(initial.keySet());
-        final Map<String, StepConfiguration> migratedProperties = 
migratePersistedProperties(initial);
-        return applyMissingRequiredPropertyDefaults(migratedProperties, 
persistedStepNames, getConnector().getConfigurationSteps());
+        final Map<String, StepConfiguration> migratedProperties = 
migratePersistedProperties(connector, initial);
+        return applyMissingRequiredPropertyDefaults(migratedProperties, 
persistedStepNames, connector.getConfigurationSteps());
     }
 
-    private Map<String, StepConfiguration> migratePersistedProperties(final 
Map<String, StepConfiguration> initial) {
+    private Map<String, StepConfiguration> migratePersistedProperties(final 
Connector connector, final Map<String, StepConfiguration> initial) {
         final StandardConnectorPropertyConfiguration propertyConfiguration = 
new StandardConnectorPropertyConfiguration(initial, this.toString());
-        try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, 
getConnector().getClass(), getIdentifier())) {
-            getConnector().migrateProperties(propertyConfiguration);
-            return 
retainDeclaredProperties(propertyConfiguration.getMutatedProperties(), 
getConnector().getConfigurationSteps());
+        try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, connector.getClass(), 
getIdentifier())) {

Review Comment:
   **Medium — run migration under the replacement classloader**
   
   `withComponentNarLoader(extensionManager, connector.getClass(), 
getIdentifier())` resolves the registered instance classloader first. During 
replacement, the connector ID remains registered to the old version, so the 
replacement's `migrateProperties()` runs with the old thread context 
classloader. Context-based resource or service loading can therefore resolve 
against the old NAR. Please use 
`NarCloseable.withComponentNarLoader(connector.getClass().getClassLoader())` 
and add a test confirming replacement migration observes its own classloader.



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/service/extension-types.service.ts:
##########
@@ -103,4 +103,13 @@ export class ExtensionTypesService {
     getConnectorTypes(): Observable<any> {
         return 
this.httpClient.get(`${ExtensionTypesService.API}/flow/connector-types`);
     }
+
+    getConnectorVersionsForType(connectorType: string, bundle: Bundle): 
Observable<any> {
+        const params = {
+            bundleGroupFilter: bundle.group,
+            bundleArtifactFilter: bundle.artifact,
+            type: connectorType
+        };

Review Comment:
   **Medium — intersect connector versions across cluster nodes**
   
   `/flow/connector-types` is replicated, but no `ConnectorTypesEndpointMerger` 
is registered, so the coordinator returns an arbitrary node's version set. 
Other extension inventories use endpoint mergers backed by the existing generic 
`DocumentedTypesMerger.mergeDocumentedTypes()`. Please add a 
`ConnectorTypesEndpointMerger` that extracts 
`ConnectorTypesEntity.getConnectorTypes()`, delegates to 
`DocumentedTypesMerger`, and register it in `StandardHttpResponseMapper`. Add a 
test covering differing node inventories.



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