cschneider commented on a change in pull request #8: SLING-8531 - Exponential 
backoff for retries
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/8#discussion_r301687161
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/distribution/journal/impl/shared/JournalAvailableChecker.java
 ##########
 @@ -127,4 +137,22 @@ private void unRegister() {
             this.reg = null;
         }
     }
+
+    @Override
+    public synchronized void handleEvent(Event event) {
+        String type = (String) 
event.getProperty(ExceptionEventSender.KEY_TYPE);
+        int curNumErrors = this.numErrors.incrementAndGet();
+        if (this.backoffRetry == null && curNumErrors >= MIN_ERRORS) {
+            LOG.warn("Received exception event {}. Journal is considered 
unavailable.", type);
+            unRegister();
+            startChecks(); 
+        } else {
+            LOG.info("Received exception event {}. {} of {} errors occured.", 
type, this.numErrors.get(), MIN_ERRORS);
 
 Review comment:
   Makes sense.

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


With regards,
Apache Git Services

Reply via email to