allthingssecurity commented on code in PR #30919:
URL: https://github.com/apache/camel/pull/30919#discussion_r4716753900


##########
core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRoutePolicy.java:
##########
@@ -272,6 +276,18 @@ public void onRemove(Route route) {
         stoppedRoutes.remove(route);
     }
 
+    @Override
+    public void onStart(Route route) {

Review Comment:
   Thanks, the Javadoc is in 24a10c47 (Claus added it on the branch).



##########
core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRoutePolicy.java:
##########
@@ -309,6 +327,25 @@ private void removeCamelEventListeners() {
         }
     }
 
+    private void restart() {
+        LOG.debug("ClusteredRoutePolicy for namespace {} is used again after 
it was shut down", namespace);
+        // a change queued when the executor was shut down was dropped, and 
the CamelContext starts again
+        leadershipChangePending.set(false);
+        reapply.set(false);
+        retryScheduled.set(false);
+        contextStarted.set(false);
+        contextResumed = false;
+        initialDelayElapsed = false;
+        // the routes are created while the CamelContext initializes: start 
them once it has started
+        startManagedRoutesEarly = true;
+        camelContext.getManagementStrategy().addEventNotifier(listener);

Review Comment:
   Thanks, restart() clears failedStarts in 24a10c47 (added by Claus). The map 
only counts failed attempts for the log; retries come from scheduleRetry(), so 
clearing it cannot drop a retry. Checked: 
ClusteredRoutePolicyLateStartAndRestartTest 6/6 and the cluster and route 
policy tests pass on that head.



-- 
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]

Reply via email to