davsclaus opened a new pull request, #26946: URL: https://github.com/apache/camel/pull/26946
Fixes [CAMEL-25063](https://issues.apache.org/jira/browse/CAMEL-25063): bugs in the route and CamelContext MBeans found in a deep review. Each fix has a test in `ManagedRouteAndContextEdgeCasesTest` that fails without it. 1. **`dumpStepStatsAsXml` of the CamelContext is not well-formed XML.** Each route was closed with `</stepStat>` instead of `</routeStat>`, and `</stepStats>` was written once per step of the whole context (it was inside the loop). Since 2019. 2. **The `generatedIds` flag is ignored** by `dumpRouteAsXml(resolvePlaceholders, generatedIds)` of a route and `dumpRoutesAsXml(resolvePlaceholders, generatedIds)` / `dumpRoutesAsYaml(resolvePlaceholders, uriAsParameters, generatedIds)` of the context, which always dumped the generated ids. Regression in 4.16 (CAMEL-22605). 3. **`reset(true)` of a route (and of the CamelContext) does not reset the steps of the route**, as step MBeans are registered as their own type. 4. **`reset(true)` of a route resets the processors of other routes when the route id has `*` or `?`**: the route id was matched as a wildcard pattern. 5. **The percentiles (`ProcessingTimeP50/P95/P99`) and the stats dumps can fail with `ArrayIndexOutOfBoundsException`**: the count of the percentile window is updated without a lock by concurrent exchanges and can go past the window, after which every call failed until reset (Extended statistics level). 6. **`reset()` of a route, the CamelContext or a route group does not reset the load averages** (only `reset(boolean)` did). 7. **The XML stats dumps are not well-formed when a value has a quote**: attribute values were escaped for `& < >` only, and the source location not at all. **Not changed (for a later look)** - Turning `StatisticsEnabled` off or on while exchanges are inflight leaves the inflight count of the route, context and route group wrong for good. - Removing an exhausted route of the supervising route controller leaves it in the controller's lists (NPE in `routeStatus`, exhausted count stays). That is `DefaultSupervisingRouteController`, which open PRs 26867/26868 change. - `Redeliveries` does not count the last redelivery when it succeeds. - The JSON route stats dump of the context lacks `exchangesInflight`, which the XML dump has. The whole `camel-management` test suite passes. _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]
