shashank created CAMEL-27170:
--------------------------------
Summary: camel-core - Supervising route controller: stopRouteGroup
and startRouteGroup bypass the supervisor, so a stopped route is restarted by
its back-off task
Key: CAMEL-27170
URL: https://issues.apache.org/jira/browse/CAMEL-27170
Project: Camel
Issue Type: Bug
Components: camel-core
Reporter: shashank
Assignee: shashank
h3. What happens
{{DefaultSupervisingRouteController}} overrides {{startRoute}}, {{stopRoute}},
{{suspendRoute}} and {{resumeRoute}}: they release the route from the route
manager (cancel its back-off restart task, clear its exhausted state) and mark
it as managed or not. {{startRouteGroup}} and {{stopRouteGroup}} are not
overridden, so they go straight to {{AbstractCamelContext}} and skip all of
that:
* A route of the group that failed to start and waits for a restart attempt is
not stopped by {{stopRouteGroup}} (it is not in the started routes), and its
restart task keeps running: once the cause is gone, the task starts the route,
although the operator stopped its group. {{stopRoute}} of the same route keeps
it stopped (CAMEL-25010).
* A route whose restarts were exhausted and that is started with
{{startRouteGroup}} runs, but stays in the exhausted routes: with
{{unhealthyOnExhausted=true}} the route controller health check stays DOWN for
good. {{startRoute}} clears it (CAMEL-25001).
* A route that fails to start in {{startRouteGroup}} is not handed to the
supervisor, so it is never restarted. {{startRoute}} hands it over.
Route groups are started and stopped through JMX ({{ManagedRouteGroup}}), the
developer console and the Camel CLI.
h3. How to reproduce
{{DefaultSupervisingRouteControllerRouteGroupTest}} (camel-core): a route in
group {{myGroup}} whose consumer fails to start; {{stopRouteGroup("myGroup")}}
leaves its restart task in place; {{startRouteGroup}} after the restarts are
exhausted leaves it exhausted and unhealthy; a failed {{startRouteGroup}}
leaves it without a restart task.
h3. Fix
The supervising route controller overrides {{startRouteGroup}} and
{{stopRouteGroup}} and does for each route of the group what {{startRoute}} and
{{stopRoute}} do, under the same lock and in the same lock order.
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)