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

optimize: pass the sqlexception to client when get lock #4946

Merged
merged 6 commits into from Sep 28, 2022

Conversation

Bughue
Copy link
Contributor

@Bughue Bughue commented Sep 21, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

doAcquireLocks实现里把SQLException都吞掉了,估计是因为认为出现这种异常都是因为唯一键冲突,所以默认为这个是锁冲突。当其他异常发生时,他也把异常吞掉就不合适了。
这个pr只在catch到唯一键时返回false,其余情况直接throw。

分析锁冲突和其他异常在TC端和client端的表现
TM
image
client
image
image

Ⅱ. Does this pull request fix one issue?

fixes #4941

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Merging #4946 (3d6d400) into develop (843489d) will increase coverage by 0.48%.
The diff coverage is 0.00%.

❗ Current head 3d6d400 differs from pull request most recent head fb31a68. Consider uploading reports for the commit fb31a68 to get more accurate results

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4946      +/-   ##
=============================================
+ Coverage      48.70%   49.19%   +0.48%     
- Complexity      4078     4113      +35     
=============================================
  Files            736      736              
  Lines          25818    25820       +2     
  Branches        3184     3184              
=============================================
+ Hits           12575    12701     +126     
+ Misses         11907    11773     -134     
- Partials        1336     1346      +10     
Impacted Files Coverage Δ
...a/server/storage/db/lock/LockStoreDataBaseDAO.java 50.73% <0.00%> (-0.51%) ⬇️
...r/console/impl/file/GlobalLockFileServiceImpl.java 94.87% <0.00%> (-2.57%) ⬇️
...torage/file/store/FileTransactionStoreManager.java 56.27% <0.00%> (+0.64%) ⬆️
...rage/redis/store/RedisTransactionStoreManager.java 66.57% <0.00%> (+0.84%) ⬆️
...in/java/io/seata/server/session/SessionHelper.java 66.66% <0.00%> (+1.04%) ⬆️
...a/io/seata/rm/datasource/xa/DataSourceProxyXA.java 75.55% <0.00%> (+2.22%) ⬆️
.../java/io/seata/server/coordinator/DefaultCore.java 47.92% <0.00%> (+2.95%) ⬆️
...o/seata/server/coordinator/DefaultCoordinator.java 47.75% <0.00%> (+3.26%) ⬆️
...erver/storage/file/session/FileSessionManager.java 53.50% <0.00%> (+5.73%) ⬆️
...n/src/main/java/io/seata/common/util/IdWorker.java 83.33% <0.00%> (+6.25%) ⬆️
... and 3 more

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

@funky-eyes funky-eyes added this to the 1.6.0 milestone Sep 23, 2022
@Bughue Bughue changed the title optimize: throw non-SQLIntegrityConstraintViolationException when doAcquireLocks optimize: throw non-conflict-exception when doAcquireLocks Sep 23, 2022
@Bughue Bughue changed the title optimize: throw non-conflict-exception when doAcquireLocks optimize: throw non-conflict-exception when client get lock Sep 23, 2022
@Bughue Bughue changed the title optimize: throw non-conflict-exception when client get lock optimize: pass the sqlexception to client when get lock Sep 23, 2022
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

@slievrly slievrly merged commit 141d855 into apache:develop Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TC端发生异常后,异常sqlexception没有包装回传给client端
4 participants