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

   # Description
   
   [CAMEL-25419](https://issues.apache.org/jira/browse/CAMEL-25419): fixes to 
how the Saga EIP reports a compensation that could not be done.
   
   - **The original exception is kept.** When a step fails in AUTO completion 
mode and the compensation then fails too, `SagaProcessor` used to replace the 
exchange exception with `Unable to compensate all required steps of the saga 
<id>`. It now keeps the exception that caused the compensation and adds the 
compensation failure to it as a suppressed exception. This applies to every 
saga service, including LRA when the call that asks the coordinator to 
compensate fails.
   - **`InMemorySagaCoordinator` has a `FAILED` status.** Previously a saga 
whose compensation (or completion) failed after all retries was marked 
`COMPENSATED` (or `COMPLETED`), so a later `compensate()` or `complete()` call 
reported success. It is now marked `FAILED`, and those calls fail.
   - **`InMemorySagaService.doStop` logs the sagas it abandons.** A 
compensation retry that is pending when the CamelContext stops is dropped, as 
expected for a non-persistent service. Until now nothing was logged. The 
service now logs a warning with the ids of the sagas that are not finalized.
   - **`saga-eip.adoc`:** the "manual intervention" sentence now says what the 
in-memory service actually does.
   
   The scope is kept small on purpose: the in-memory saga service is not 
recommended for production (see the Saga EIP docs).
   
   **Tests:**
   - New `SagaCompensationFailureTest` (3 tests): all three fail on `main` and 
pass with this change.
   - All 46 `Saga*` tests in camel-core and the 33 camel-lra unit tests pass.
   - `-Psourcecheck` passes on the changed modules.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes. (Ran `mvn -Psourcecheck 
-DskipTests verify` on the changed modules instead; it regenerated no files.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   _Claude Code on behalf of Federico Mariani_
   


-- 
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