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

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

commit 430194baa3a9597fde6c0c3a73503b67ffa607c5
Author: Otavio Rodolfo Piske <opi...@redhat.com>
AuthorDate: Wed Oct 20 17:13:03 2021 +0200

    (chores) camel-couchdb: check whether is runnable before triggering the 
wait stability check
    
    This prevents it from throwing exceptions when shutting down the component 
and resolve multiple exception messages in the test logs.
---
 .../apache/camel/component/couchdb/CouchDbChangesetTracker.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbChangesetTracker.java
 
b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbChangesetTracker.java
index 8b6a275..eb2936e 100644
--- 
a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbChangesetTracker.java
+++ 
b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbChangesetTracker.java
@@ -91,8 +91,12 @@ public class CouchDbChangesetTracker implements Runnable {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("CouchDb Exception encountered waiting for 
changes!  Attempting to recover...", e);
                     }
-                    if (!waitForStability(lastSequence)) {
-                        throw e;
+                    if (endpoint.isRunAllowed() || !endpoint.isShutdown() || 
!consumer.isStopped()) {
+                        if (!waitForStability(lastSequence)) {
+                            throw e;
+                        }
+                    } else {
+                        LOG.debug("Skipping the stability check because 
shutting down or running is not allowed at the moment");
                     }
                 }
             }

Reply via email to