apache / incubator-seata-go

Go Implementation For Seata
https://seata.apache.org/
Apache License 2.0
1.56k stars 283 forks source link

fix: xa report state to TC #717

Open Code-Fight opened 4 days ago

Code-Fight commented 4 days ago

What this PR does:

  1. Move defer before beginTX to cover the scenario where a rollback is not reported before conn.start.
  2. fix err := use

Which issue(s) this PR fixes:

Fixes #709

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

luky116 commented 2 days ago

这个问题,能根据 seata-java 那边的描述进行复现吗?

Code-Fight commented 1 day ago

这个问题,能根据 seata-java 那边的描述进行复现吗?

尝试了,不太好复现。那个时机不太好造出来 我参考java的代码,java那边是start的时候没有report,看了下go这边是在beginTx里面,但是 defer在beginTx之后,所以挪上去后,就可以有error的时候 直接report 到TC了