Claus Ibsen created CAMEL-25063:
-----------------------------------
Summary: camel-management - Route and CamelContext MBeans: fix
bugs found in a deep review
Key: CAMEL-25063
URL: https://issues.apache.org/jira/browse/CAMEL-25063
Project: Camel
Issue Type: Bug
Components: camel-core
Reporter: Claus Ibsen
A deep review of the route and CamelContext MBeans in camel-management found
the bugs below. Each one was reproduced against 4.23.0-SNAPSHOT and has a test
in ManagedRouteAndContextEdgeCasesTest that fails without the fix.
# *dumpStepStatsAsXml of the CamelContext is not well-formed XML.* It closed
each route with </stepStat> instead of </routeStat>, and wrote </stepStats>
once per step of the whole context (inside the loop).
# *The generatedIds flag is ignored.* dumpRouteAsXml(resolvePlaceholders,
generatedIds) of a route, and dumpRoutesAsXml(resolvePlaceholders,
generatedIds) / dumpRoutesAsYaml(resolvePlaceholders, uriAsParameters,
generatedIds) of the context, always dumped the generated ids. Regression in
4.16 (CAMEL-22605).
# *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.
# *reset(true) of a route resets the processors of other routes when the route
id has * or ?*, as the route id was matched as a wildcard.
# *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).
# *reset() of a route, the CamelContext or a route group does not reset the
load averages* (only reset(boolean) of a route or the context did).
# *The XML stats dumps are not well-formed when a value has a quote*: the
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 (NullPointerException in routeStatus, exhausted count
stays); this is in 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.
_Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)