davsclaus opened a new pull request, #24827: URL: https://github.com/apache/camel/pull/24827
## Summary _Claude Code on behalf of davsclaus_ `InMemorySagaService.newSaga()` puts every new coordinator into the `coordinators` ConcurrentHashMap, but nothing ever removes entries — not on `complete()`, not on `compensate()`, not on timeout. This causes unbounded memory growth in long-running applications. **Fix:** - Added package-private `removeSaga(String)` method to `InMemorySagaService` - `InMemorySagaCoordinator` now calls `removeSaga()` after reaching terminal state (COMPENSATED or COMPLETED) in `doCompensate()` and `doComplete()` - Removal happens in the `.thenApply()` block after the finalization chain completes, so all step callbacks have finished before the coordinator is removed ## Test plan - [x] New `SagaCoordinatorCleanupTest` verifying coordinators are removed from the map after both completion and compensation - [x] Updated `SagaTimeoutTest` to accept the additional valid outcome when a coordinator is removed before a late joiner tries to access it - [x] All existing saga tests pass (21 tests across 7 test classes) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.6 <[email protected]> -- 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]
