temporalio / temporalio/sdk-java
Run Saga compensations in a disconnected scope
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Is your feature request related to a problem? Please describe.
Currently Saga.compensate is called in the current cancellation scope. It means that in the case of cancellation the compensations are not going to run. So it requires that compensate is called in the detached cancellation scope. But our sample does not do it.
Describe the solution you'd like
By default execute compensation actions in a disconnected cancellation scope. Add Saga.Option to disable this behavior.
Change bookingsaga sample to catch TemporalFailure to support cancellation scenarios.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Saga compensation implementation and its Option API, then inspect src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflowImpl.java. Verify how cancellation affects compensation and how the sample currently handles failures. Done means compensations run in a disconnected scope by default, an option can disable that behavior, and the bookingsaga sample supports cancellation scenarios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100