davsclaus opened a new pull request, #27072:
URL: https://github.com/apache/camel/pull/27072

   Fixes the remaining items of CAMEL-25071 (item 4, the JSON route stats dump, 
is in #27071).
   
   1. **Inflight count after toggling StatisticsEnabled**: the route MBean is 
wired with a `CompositePerformanceCounter` (route, CamelContext, route group) 
that checked `isStatisticsEnabled()` of each counter separately when the 
exchange began and when it completed. Disabling statistics while an exchange 
was inflight left the inflight count at +1 for good, and enabling it left it at 
-1 (this also feeds the load averages). Now the composite forwards to all 
counters, and `ManagedPerformanceCounter` always keeps the inflight count and 
only gathers the other statistics when enabled. When every counter is disabled 
the composite reports itself disabled, so the instrumentation processor skips 
the exchange as before (no extra cost with statistics off). The remote inflight 
count of the CamelContext follows the same rule.
   2. **Removing an exhausted route of the supervising route controller**: 
`onRemove` only removed the route from the controlled routes, so it stayed in 
the restarting/exhausted maps (still unhealthy, and `routeStatus` of the MBean 
failed on the missing route). It now also releases the route from the route 
manager and from the non-supervised route ids.
   3. **Redeliveries**: only redelivery attempts that failed were counted, so a 
processor that succeeded on its second redelivery reported 1 instead of 2, and 
a route whose exchange was redelivered and then completed reported 0. A 
successful redelivery is now counted too. Documented in the 4.23 upgrade guide.
   
   Tests that fail without the fixes: `ManagedStatisticsEnabledInflightTest`, 
`DefaultSupervisingRouteControllerExhaustedRemoveTest`, 
`ManagedRedeliverTest#testRedeliverSucceeds`. The full camel-management test 
suite passes (512 tests).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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]

Reply via email to