pvillard31 commented on code in PR #11872:
URL: https://github.com/apache/nifi/pull/11872#discussion_r4466550735


##########
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java:
##########
@@ -148,6 +148,8 @@ public class NiFiProperties extends ApplicationProperties {
     public static final String CONNECTOR_REPOSITORY_IMPLEMENTATION = 
"nifi.connector.repository.implementation";
     public static final String CONNECTOR_SYNC_TIMEOUT = 
"nifi.connector.sync.timeout";
     public static final String DEFAULT_CONNECTOR_SYNC_TIMEOUT = "5 mins";
+    public static final String CONNECTOR_FLOW_EVOLUTION_TIMEOUT = 
"nifi.components.connectors.flow.evolution.timeout";

Review Comment:
   Should this property use the existing `nifi.connector.` prefix (for example 
`nifi.connector.flow.evolution.timeout`), to match 
`nifi.connector.sync.timeout` just above? Can we also add it to the 
Administration Guide?



##########
nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorRepository.java:
##########
@@ -125,10 +125,15 @@ public interface ConnectorRepository {
 
     /**
      * Starts the given Connector, managing any appropriate lifecycle events.
+     * When a flow evolution is pending, the context persists the flow after 
phase one is applied, after the connector starts, and when the evolution fails.
+     * The context is required even when no evolution is pending.
+     *
      * @param connector the Connector to start
+     * @param persistenceContext persists the flow during evolution
      * @return a CompletableFuture that will be completed when the Connector 
has started
+     * @throws NullPointerException if the persistence context is null
      */
-    Future<Void> startConnector(ConnectorNode connector);
+    Future<Void> startConnector(ConnectorNode connector, 
ConnectorUpdateContext persistenceContext);

Review Comment:
   Since the repository implementation is configurable, should we keep the old 
`startConnector(ConnectorNode)` as a default method (or give 
`getFlowEvolutionStatus` a default) so custom implementations do not break?



##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java:
##########
@@ -408,7 +408,16 @@ public Future<Void> unschedule(final ReportingTaskNode 
taskNode) {
      */
     @Override
     public synchronized CompletableFuture<Void> startProcessor(final 
ProcessorNode procNode, final boolean failIfStopping) {
-        final LifecycleState lifecycleState = 
getLifecycleState(requireNonNull(procNode), true, false);
+        requireNonNull(procNode);
+        final CompletableFuture<Void> pendingStart = 
processorStartFutures.get(procNode.getIdentifier());

Review Comment:
   This early return applies to all processors, not only Connector ones. Can we 
add a unit test for the pending-start and already-running cases?



##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorRepository.java:
##########
@@ -733,6 +918,61 @@ private void waitForState(final ConnectorNode connector, 
final Set<ConnectorStat
         }
     }
 
+    private void waitForFlowEvolutionStatus(final ConnectorNode connector, 
final FlowEvolutionStatus desiredStatus)

Review Comment:
   Should this wait have an overall timeout, so the coordinator does not loop 
forever when a node stays in CONNECTING?



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