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

Saga with raise inside SagaActionStep don't rollback #3458

Open
outlndrr opened this issue Jun 18, 2024 · 3 comments
Open

Saga with raise inside SagaActionStep don't rollback #3458

outlndrr opened this issue Jun 18, 2024 · 3 comments

Comments

@outlndrr
Copy link

Hi, there is a problem if raise happened inside SagaActionStep then saga don't rollback action, but return Either.Left. Example code:

suspend fun main() {
    // perform the transaction
    val result = either {
        saga {
            saga({
                raise("failed")
                println("Action A")
            }) { println("Rollback A") }
        }.transact()
    }
    println(result)
}

Arrow version: 1.2.4

@kyay10
Copy link
Collaborator

kyay10 commented Jun 18, 2024

What printout are you getting, and what's your expected output?

@outlndrr
Copy link
Author

What printout are you getting, and what's your expected output?

It printed Either.Left and that was all. I expected it to run a rollback and print "Rollback A" and return Either.Left.

@nomisRev
Copy link
Member

@outlndrr that should indeed result in rolling back the action. Thank you for reporting this issue, I think this is fixed on 2.0.0 but might be missing a test case. So leaving this issue open!

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

No branches or pull requests

3 participants