davsclaus opened a new pull request, #26938: URL: https://github.com/apache/camel/pull/26938
Fixes [CAMEL-25055](https://issues.apache.org/jira/browse/CAMEL-25055): bugs in the error registry found in a deep review. Each fix has a test that fails without it (`ErrorRegistryEdgeCasesTest`, `ManagedErrorRegistryTest`). Most of them came from one assumption: an exchange has at most one entry, and the first wins. The registry now only merges two captures of **the same failure** (the same exception, or one that wraps the other), as reported by a correlated copy and its original exchange, so CAMEL-24863 (circuit breaker fallback recorded as handled) stays covered — its tests in camel-resilience4j and camel-microprofile-fault-tolerance pass. 1. **An error that was not handled is recorded as handled.** `ExchangeFailureHandledEvent` means a failure processor ran, not that the exception was handled: `onException` without `handled(true)`, `handled(false)` and a `doCatch` that throws again were recorded as handled. It is now handled only when the exchange no longer has an exception. 2. **A second failure of the same exchange is dropped.** After a `doCatch` (or `onException` continued) recorded a handled error, the failure that failed the exchange was not recorded. 3. **The failures of the parts of a split replace each other** (also multicast, recipient list, seda): each part's failure removed every entry of the parent exchange. 4. **A failure inside `onCompletion` hides the failure of the route.** 5. **With `noErrorHandler`, a failure in a route the exchange was sent to is recorded with the route it came from** (the node was from the failing route). The route id is now taken from the message history, as the node is. 6. **`forRoute(id).clear()` does not reset the repeat counts of the route**, as `clear()` does. 7. **The JMX browse fails with `KeyAlreadyExistsException` when two entries have the same exchange id**, as its table was indexed by exchange id (possible before with a parallel split, common now). It is now indexed by the entry's uid (a new `uid` item). **Not changed (for a later look)** - The message data of a handled error is captured after the failure processor ran (so it shows e.g. the error response of `onException`), and the node of an error caught by a `doCatch` that throws again is the node of the new throw. - With an error handler on a route that sent the exchange to another route, the failure route id may be overwritten by the sending route (`captureFailureOrigin`). 1 and 2–4 are in the 4.23 upgrade guide. The whole `camel-core` and `camel-management` test suites pass (two timing tests passed on rerun). _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
