allthingssecurity commented on PR #30835: URL: https://github.com/apache/camel/pull/30835#issuecomment-7185663805
Thanks Claus, good catch on both cases. Fixed in 2256944c67a6 as you suggested. The exception policy now remembers the consumer it suspended when it opened (or reopened) the circuit, also when the inflight policy had suspended it first, in a set as one instance can be used by several routes. `isConsumerKeptSuspended` returns true only for a consumer in that set, with `releasingConsumer` still the first read, then the state, then the set. The consumer is added before the state becomes open, and the set is cleared when the circuit is half opened or closed (inside the flag window) and when the policy stops. A route also drops its consumer when it is started or removed, so after a CamelContext restart or a route re-add the started consumer is not claimed and the inflight policy resumes it as on main. No new lock. Two new tests in `ThrottlingInflightAndExceptionRoutePolicyTest`: one exception policy on two routes, each with its own inflight policy (route B is resumed by its own inflight policy while A's circuit is open, A waits for the half open check), and a CamelContext stop/start with the circuit still open. Both fail on the previous head (3 of 3 runs each) and pass with the change; the class 10 times in one JVM, 100 runs, 0 failures, and the camel-core/camel-support route policy and throttling tests pass. The route-policy.adoc paragraph and the upgrade guide entry now say the claim is only for the consumer the circuit was opened for. Still merges cleanly with #30837. PR description updated. -- 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]
