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

   ## Summary
   
   _Claude Code on behalf of gnodet_
   
   - **Synchronize `setMaxInflightExchanges` and `setResumePercentOfMax`** to 
prevent concurrent JMX callers from producing a `ThrottlingLimits` holder with 
mixed stale values. Both setters read the other's field to recompute the resume 
limit — without synchronization, two concurrent callers can each read a stale 
snapshot, resulting in an inconsistent holder.
   - **Add concurrency test** (`ThrottlingInflightRoutePolicySetterTest`) that 
hammers both setters from separate threads with a `CyclicBarrier` and verifies 
the invariant: the published `ThrottlingLimits` always reflects a consistent 
`(max, resume)` pair.
   - These setters are JMX-invoked (management operations), so contention is 
negligible — `synchronized` is the simplest correct solution.
   
   **JIRA:** [CAMEL-24267](https://issues.apache.org/jira/browse/CAMEL-24267)
   **Follow-up to:** PR #24985 (CAMEL-24227) which fixed reader-side tearing 
but left writer-side atomicity unaddressed.
   
   ## What changed
   
   | File | Change |
   |------|--------|
   | `ThrottlingInflightRoutePolicy.java` | Added `synchronized` to both setter 
methods |
   | `ThrottlingInflightRoutePolicySetterTest.java` | New: 3 tests — concurrent 
hammering, single-threaded correctness, edge-case clamping |
   
   ## Test plan
   
   - [x] New `ThrottlingInflightRoutePolicySetterTest` passes (3 tests)
   - [x] Existing `ThrottlingInflightRoutePolicyTest` passes
   - [ ] CI green
   
   🤖 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