You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "sejal-gupta-ksolves (via GitHub)" <gi...@apache.org> on 2026/10/04 17:53:42 UTC

[PR] NIFI-15868: Await lifecycle CompletableFuture in scheduleConnector [nifi]

sejal-gupta-ksolves opened a new pull request, #11755:
URL: https://github.com/apache/nifi/pull/11755

   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-15868](https://issues.apache.org/jira/browse/NIFI-15868)
   
   # Description
   
   When scheduling a Connector (transitioning state to `RUNNING` or `STOPPED`), `StandardNiFiServiceFacade.scheduleConnector()` previously invoked `startConnector()` / `stopConnector()` on `ConnectorDAO` without waiting for the asynchronous lifecycle transition tasks to complete.
   
   This PR updates `ConnectorDAO` and `StandardConnectorDAO` to return the `Future<Void>` produced by the underlying connector repository. `StandardNiFiServiceFacade.scheduleConnector()` now awaits completion using `Future.get()`, ensuring that state transition exceptions are caught and logged appropriately and that client calls block until the state transition is finished.
   
   # Tracking Issue
   
   JIRA Issue: [NIFI-15868](https://issues.apache.org/jira/browse/NIFI-15868)
   
   # Changes Made
   
   - **`ConnectorDAO` & `StandardConnectorDAO`**: Updated `startConnector(String id)` and `stopConnector(String id)` return types from `void` to `Future<Void>`.
   - **`StandardNiFiServiceFacade`**: Updated `scheduleConnector()` to capture the `Future<Void>` returned from DAO calls and await completion via `.get()`. Added exception handling for `InterruptedException` and `ExecutionException`.
   - **`StandardNiFiServiceFacadeTest`**: Added `testScheduleConnectorStopAwaitsFuture()` to verify that connector scheduling properly waits for lifecycle future execution.
   
   # Verification & Testing
   
   - Executed localized unit tests in `nifi-web-api`:
     ```bash
     mvn clean test -Denforcer.skip=true -pl :nifi-web-api -Dtest=StandardNiFiServiceFacadeTest


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15868: Await lifecycle CompletableFuture in scheduleConnector [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #11755: NIFI-15868: Await lifecycle CompletableFuture in scheduleConnector
URL: https://github.com/apache/nifi/pull/11755


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15868: Await lifecycle CompletableFuture in scheduleConnector [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11755:
URL: https://github.com/apache/nifi/pull/11755#issuecomment-5998620453

   Yeah, agreed, switching this to synchronous is not desirable. The Jira noting that a manual refresh is required is somewhat misleading. A follow-up GET poll is required. That does not necessitate a manual refresh; that sounds like a leaky detail of some specific UI perhaps. We definitely cannot make this a blocking call, however. Depending on the component, stop could take a long time.


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15868: Await lifecycle CompletableFuture in scheduleConnector [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on PR #11755:
URL: https://github.com/apache/nifi/pull/11755#issuecomment-5998684231

   Thanks for confirming @markap14.
   
   I will close this pull request for now. @sejal-gupta-ksolves If you are still interested in working on this issue, feel free to ask questions on the linked Jira issue to scope out potential solutions.


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org