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

bugfix: fix business exception is lost when compensation succeed in saga mode #2839

Merged
merged 3 commits into from
Jun 30, 2020

Conversation

wangliang181230
Copy link
Contributor

@wangliang181230 wangliang181230 commented Jun 28, 2020

Ⅰ. Describe what this PR did

bug修复:在SAGA事务,以同步方式执行时,正向服务出现异常,补偿方法执行成功后,正向服务的异常未写入,stateMachineInstance中。

现已修复。已可以通过stateMachineInstance.getException()方法获取到该异常了。

此PR从 #2551 中拆分出来的。

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

以同步方式执行SAGA事务,并故意在业务方法中抛出异常,并使冲正补偿执行成功。然后在事务结束后,通过stateMachineInst.getException(),看看是否可以获取到业务方法中抛出的异常信息。

Ⅴ. Special notes for reviews

@wangliang181230
Copy link
Contributor Author

@long187 ,我从PR #2551 里拆分出来了几个PR,麻烦review一下吧。

@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2020

Codecov Report

Merging #2839 into develop will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2839      +/-   ##
=============================================
- Coverage      50.03%   50.02%   -0.01%     
+ Complexity      2954     2952       -2     
=============================================
  Files            592      592              
  Lines          18998    18995       -3     
  Branches        2290     2290              
=============================================
- Hits            9506     9503       -3     
+ Misses          8549     8547       -2     
- Partials         943      945       +2     
Impacted Files Coverage Δ Complexity Δ
...io/seata/saga/proctrl/impl/ProcessContextImpl.java 26.41% <25.00%> (-0.38%) 9.00 <0.00> (ø)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 28.00% <0.00%> (-1.00%)
...in/java/io/seata/server/session/GlobalSession.java 83.71% <0.00%> (-0.46%) 71.00% <0.00%> (-1.00%)

@funky-eyes funky-eyes requested a review from long187 June 28, 2020 08:04
Copy link
Contributor

@long187 long187 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@long187 long187 added this to the 1.3.0 milestone Jun 30, 2020
@slievrly slievrly added the module/saga saga module label Jun 30, 2020
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangliang181230 wangliang181230 changed the title bugfix: When the compensation service is executed successfully, the business exception is not written to the StateMachineInstance bugfix: fix business exception is lost when the compensation is successfully executed in the saga mode. Jun 30, 2020
@wangliang181230 wangliang181230 changed the title bugfix: fix business exception is lost when the compensation is successfully executed in the saga mode. bugfix: fix business exception is lost when compensation succeed in saga mode Jun 30, 2020
@slievrly slievrly merged commit ce2239e into apache:develop Jun 30, 2020
@wangliang181230 wangliang181230 deleted the saga-optimize-exception branch June 30, 2020 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/saga saga module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants