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

   ## Summary
   
   - Replace `synchronized` blocks and methods with `ReentrantLock` in 
telemetry and metrics components to improve virtual thread compatibility (part 
of CAMEL-20199).
   - Converts 6 files across 3 modules: `camel-opentelemetry-metrics`, 
`camel-opentelemetry2`, and `camel-telemetry-dev`.
   - The `synchronized` keyword pins virtual threads to platform threads; 
`ReentrantLock` allows the virtual thread to unmount during contention, 
improving scalability.
   
   ### Files changed
   
   | File | Change |
   |------|--------|
   | `CounterProducer.java` | `Object lock` -> `ReentrantLock`, 
`synchronized(lock)` -> lock/try/finally |
   | `DistributionSummaryProducer.java` | Same pattern |
   | `TimerProducer.java` | Same pattern |
   | `OpenTelemetryRoutePolicyFactory.java` | Remove `synchronized` method 
keyword, add `ReentrantLock` field, wrap body in lock/try/finally |
   | `DevSpanExporter.java` | Replace 4 `synchronized(traces)` blocks with 
`ReentrantLock` |
   | `InMemoryCollector.java` | Replace 2 `synchronized` methods with 
`ReentrantLock` |
   
   ## Test plan
   
   - [x] `mvn test` passes in `camel-opentelemetry-metrics` (89 tests)
   - [x] `mvn test` passes in `camel-opentelemetry2` (37 tests)
   - [x] `mvn test` passes in `camel-telemetry-dev` (13 tests)
   - [x] Code formatted with `mvn formatter:format impsort:sort`
   
   _Claude Code on behalf of gnodet_
   
   🤖 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