This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 86ed52ede8a NIFI-16667 Start Management Server before Application 
Server (#12001)
86ed52ede8a is described below

commit 86ed52ede8a1161fbf095540dce1c2e9e986a396
Author: Kevin Doran <[email protected]>
AuthorDate: Thu Dec 3 14:55:58 2026 -0500

    NIFI-16667 Start Management Server before Application Server (#12001)
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
    Signed-off-by: David Handermann <[email protected]>
---
 .../src/main/java/org/apache/nifi/runtime/Application.java       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/runtime/Application.java
 
b/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/runtime/Application.java
index 79a09a68f41..40ed2835753 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/runtime/Application.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/runtime/Application.java
@@ -127,9 +127,14 @@ public class Application implements Runnable {
 
         final ManagementServer managementServer = 
ManagementServerProvider.getManagementServer(applicationServer);
 
-        // Start Application Server before Management Server
-        applicationServer.start();
+        // Start Management Server before Application Server so that bind 
failures stop startup before any components run
         managementServer.start();
+        try {
+            applicationServer.start();
+        } catch (final RuntimeException e) {
+            managementServer.stop();
+            throw e;
+        }
 
         // Add Shutdown Hook after application started
         final Runnable diagnosticsCommand = new DiagnosticsCommand(properties, 
applicationServer);

Reply via email to