Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Saga compensations in a disconnected scope #305

Open
mfateev opened this issue Jan 12, 2021 · 1 comment
Open

Run Saga compensations in a disconnected scope #305

mfateev opened this issue Jan 12, 2021 · 1 comment
Labels
enhancement User experience

Comments

@mfateev
Copy link
Member

mfateev commented Jan 12, 2021

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.

@mfateev mfateev added the enhancement User experience label Jan 12, 2021
@ShubhSingh
Copy link

ShubhSingh commented Mar 14, 2021

hi @mfateev, is this issue still open?
I tried running booking saga and when exception occurs during bookFlight compensations run as shown below.

cancelling car reservation '953c8762-fc18-4e8a-8a2b-8fe468d0381e' for 'trip2'
cancelling hotel reservation '0c7428dd-5357-480c-845d-1c558d3e20d4' for 'trip2'

I didn't understand current and disconnected cancellation scope,
does it mean that instead of exception if user deliberately cancels the flight after successful booking then compensations need to run?
I might be wrong here so please excuse me.

I checked Saga.Options to disable behavior but there's only 2 configs available as of now: parallelCompensation and continueWithError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

No branches or pull requests

2 participants