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


##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java:
##########
@@ -657,117 +661,137 @@ public CompletableFuture<Void> enable(final 
ScheduledExecutorService scheduler,
         final AtomicLong validationDelay = new AtomicLong(0);
         final ControllerServiceProvider controllerServiceProvider = 
this.serviceProvider;
         final StandardControllerServiceNode serviceNode = this;
-        scheduler.execute(new Runnable() {
+        final Runnable enablingRunnable = new Runnable() {
             @Override
             public void run() {
                 final ConfigurationContext configContext = 
providedConfigurationContext == null
                     ? new StandardConfigurationContext(serviceNode, 
controllerServiceProvider, null)
                     : providedConfigurationContext;
+                boolean enabled = false;
+                synchronized (active) {
+                    if (!active.get() || !stateTransition.isEnabling(future)) {

Review Comment:
   [gpt-5.6-sol] Good catch. I coordinated the transition to ENABLING and 
setting `active` under the same lifecycle lock in f4b420a497f. I also added 
`testEnableAfterConcurrentDisable`, which reproduces the stale active flag and 
verifies that a later enable request reaches ENABLED.



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