davsclaus opened a new pull request, #30934: URL: https://github.com/apache/camel/pull/30934
_Claude Code on behalf of Claus Ibsen (davsclaus)_ JIRA: [CAMEL-27542](https://issues.apache.org/jira/browse/CAMEL-27542), follow-up of CAMEL-27417 (#30760). When the `InMemorySagaService` stopped while a compensation or completion was still running (for example waiting for a retry), the shutdown of its executor dropped the pending retry. The outcome of the finalization was never completed, so both the caller that started it and the callers waiting for it (since CAMEL-27417) waited until the CamelContext shutdown timed out. A waiter that was released would also have answered from the status, still COMPENSATING or COMPLETING, as a success. ### Change - `InMemorySagaService.doStop`: after the executor is shut down, fails the outcome of each finalization still running with a `RejectedExecutionException` ("The in-memory saga service stopped before the saga ... was finalized"). A finalization that already set its final status is left alone. - `InMemorySagaCoordinator`: - the caller that started `compensate()` / `complete()` now follows the outcome (messages "Unable to compensate/complete ..." unchanged), so it fails too; - a waiter fails with the exception when the outcome failed while the status is still COMPENSATING / COMPLETING, otherwise it answers from the status as before; - the body of a scheduled retry fails its attempt when it throws (for example when the executor rejects it), instead of leaving it open. ### Tests New `SagaStopDuringFinalizationTest` (camel-core): a stop while a retry is pending (dropped by `shutdownNow`), and a stop while retries run after `shutdown()`. Both time out on main. All 65 `Saga*` tests in camel-core pass; the new class passed 5 runs in a row. Upgrade guide: a note next to the CAMEL-27417 entry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0128ThHB3iQdrvSRLVBGRrdP -- 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]
