allthingssecurity commented on PR #26883:
URL: https://github.com/apache/camel/pull/26883#issuecomment-5855268764

   @davsclaus addressed in 80aa2da7a (new commit on top, no force-push):
   
   - `stopConsumer` now only skips a consumer that is a `StatefulService` and 
not starting or started (`consumer instanceof StatefulService ss && 
!ServiceHelper.isStarted(ss)`). A consumer that is not a `StatefulService` is 
stopped and started again as before. For such a consumer the policy cannot tell 
whether someone else already stopped it; restarting it is still blocked by 
`isResumeOrStartConsumerAllowed` while the route is stopping, suspending, 
stopped or suspended, or Camel is stopping.
   - New `ThrottlingInflightRoutePolicyNonStatefulConsumerTest`: the route's 
consumer implements only `Consumer`. With 2 inflight and a maximum of 1 it must 
be stopped, and started again when they have completed. Negative control: with 
the previous `ThrottlingInflightRoutePolicy` it fails with `The policy should 
stop the consumer when too many exchanges are inflight ==> expected: <1> but 
was: <0>`; with this commit it passes.
   - Upgrade guide: a `camel-support` section in the 4.23 guide, saying the 
throttling policies only resume a consumer they suspended, and that the 
inflight policy no longer starts a non-`Suspendable` consumer it did not stop.
   - Fast path: `throttle()` returns before taking the lock for the resume 
check when `suspendedConsumers.isEmpty()`. This is safe because a thread that 
suspends a consumer adds it to the set before it does its own resume check, and 
every later completion checks again, so a skipped check cannot leave a consumer 
suspended.
   
   Tests: `*Throttl*,*RoutePolicy*,*Suspend*` in camel-support and camel-core: 
3 + 120 tests, 0 failures. The branch still merges cleanly with `main` (`git 
merge-tree`).
   
   _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