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

markap14 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 27ceda3  NIFI-9233 - Improve reliability of system integration tests 
(#5720)
27ceda3 is described below

commit 27ceda38bf77f5e8403a4427cdda2eaa1838520c
Author: greyp9 <[email protected]>
AuthorDate: Mon Jan 31 09:20:54 2022 -0500

    NIFI-9233 - Improve reliability of system integration tests (#5720)
---
 .../state/server/ZooKeeperStateServer.java         | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/server/ZooKeeperStateServer.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/server/ZooKeeperStateServer.java
index 3547503..4caf58d 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/server/ZooKeeperStateServer.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/server/ZooKeeperStateServer.java
@@ -175,24 +175,32 @@ public class ZooKeeperStateServer extends 
ZooKeeperServerMain {
         if (started) {
             started = false;
 
-            if (transactionLog != null) {
-                try {
-                    transactionLog.close();
-                } catch (final IOException ioe) {
-                    logger.warn("Failed to close Transaction Log", ioe);
-                }
+            if (quorumPeer != null && quorumPeer.isRunning()) {
+                quorumPeer.shutdown();
             }
 
             if (connectionFactory != null) {
-                connectionFactory.shutdown();
+                try {
+                    connectionFactory.shutdown();
+                } catch (Exception e) {
+                    logger.warn("Failed to shutdown Connection Factory", e);
+                }
             }
 
-            if (quorumPeer != null && quorumPeer.isRunning()) {
-                quorumPeer.shutdown();
+            if (embeddedZkServer != null && embeddedZkServer.isRunning()) {
+                try {
+                    embeddedZkServer.shutdown();
+                } catch (Exception e) {
+                    logger.warn("Failed to shutdown Embedded Zookeeper", e);
+                }
             }
 
-            if (embeddedZkServer != null && embeddedZkServer.isRunning()) {
-                embeddedZkServer.shutdown();
+            if (transactionLog != null) {
+                try {
+                    transactionLog.close();
+                } catch (final IOException ioe) {
+                    logger.warn("Failed to close Transaction Log", ioe);
+                }
             }
 
             if (datadirCleanupManager != null) {

Reply via email to