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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
