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


##########
components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java:
##########
@@ -82,13 +88,16 @@ public void onJobExecute(Action action, Route route) throws 
Exception {
         } else if (action == Action.SUSPEND) {
             if (routeStatus == ServiceStatus.Started) {
                 suspendOrStopConsumer(route.getConsumer());
+                if (ServiceHelper.isStopped(route.getConsumer())) {
+                    consumersStoppedBySuspend.add(route.getId());
+                }

Review Comment:
   Applied in 588c9abff3a2: the SUSPEND action reads `alreadyStopped` before 
`suspendOrStopConsumer` and records the route only when this suspend stopped 
the consumer. New test 
`scheduledSuspendDoesNotRecordAConsumerThatWasAlreadyStopped`: the consumer is 
stopped by something else while the route is started, then SUSPEND, RESUME and 
START run; the consumer must stay stopped. Without the check it fails with `the 
scheduled resume started a consumer it did not stop ==> expected: <true> but 
was: <false>`.
   
   _Claude Code on behalf of allthingssecurity_



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