[
https://issues.apache.org/jira/browse/CAMEL-24922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-24922.
---------------------------------
Fix Version/s: 4.23.0
Resolution: Fixed
The fix is merged on main, so it is in Camel 4.23.0:
* 55f17fb9e468 CAMEL-24922: camel-core - Test sticky failover wrap around with
maximumFailoverAttempts
* 80210ce04b23 CAMEL-24922: camel-core - Stop sticky failover by counting the
endpoints tried
* fd4c5603c6ca CAMEL-24922: camel-core - Sticky failover without round robin
should also try the endpoints before the last good one
Resolving, as the ticket was not updated when the PR was merged.
_Claude Code on behalf of Claus Ibsen_
> Failover load balancer in sticky mode without round robin never tries the
> endpoints before the last known good one
> ------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24922
> URL: https://issues.apache.org/jira/browse/CAMEL-24922
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: shashank
> Priority: Minor
> Fix For: 4.23.0
>
>
> With loadBalance().failover(-1, false, false, true) (sticky, no round robin),
> each exchange starts at the last known good endpoint and only moves forward
> through the list. When it reaches the end, the exchange fails. The endpoints
> before the last known good one are never tried, and the last known good index
> isn't changed, so every later exchange fails the same way, even though other
> endpoints are up and maximumFailoverAttempts is -1.
> Example with endpoints a, b, c:
> # a and b are down, c is up: the exchange succeeds on c, which becomes the
> last known good endpoint.
> # a and b come back up and c goes down: every exchange now tries only c and
> fails.
> The sticky failover requirement (CAMEL-3910) says "If endpoint2 were then to
> fail, messages start being sent to endpoint1 again", and FailoverStickyTest
> notes that this configuration "will keep retrying as its configured to never
> exhaust". With roundRobin=true the same scenario recovers.
> Cause: FailOverLoadBalancer.State starts at lastGoodIndex in sticky mode, and
> when index >= processors.length it only wraps around if round robin is
> enabled.
> Proposed fix: in sticky mode without round robin, continue from the first
> endpoint when the end of the list is reached, and stop once all endpoints
> have been tried once for the exchange.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)