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: acquire global lock fail error log print on tc #4305

Conversation

Pinocchio2018
Copy link
Contributor

@Pinocchio2018 Pinocchio2018 commented Jan 17, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

optimize error log print on tc when acquire global lock fail

Ⅱ. Does this pull request fix one issue?

fixes #4152

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

Ⅳ. Describe how to verify it

I test it with seata-samples
image

Ⅴ. Special notes for reviews

@Pinocchio2018 Pinocchio2018 force-pushed the develop_优化server端全局锁失败日志打印 branch from b5cd45f to 4621cec Compare January 18, 2022 10:46
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

Merging #4305 (e583935) into develop (d919789) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4305      +/-   ##
=============================================
- Coverage      49.01%   48.98%   -0.03%     
  Complexity      3953     3953              
=============================================
  Files            733      733              
  Lines          24978    24988      +10     
  Branches        3092     3093       +1     
=============================================
- Hits           12242    12240       -2     
- Misses         11439    11450      +11     
- Partials        1297     1298       +1     
Impacted Files Coverage Δ
...seata/core/exception/AbstractExceptionHandler.java 0.00% <0.00%> (ø)
...o/seata/server/storage/redis/lock/RedisLocker.java 36.26% <0.00%> (-1.17%) ⬇️
...in/java/io/seata/server/session/GlobalSession.java 78.65% <0.00%> (-0.40%) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 52.18% <0.00%> (-0.37%) ⬇️

@funky-eyes funky-eyes added this to the 1.5.0 milestone Jan 22, 2022
@objcoding objcoding self-requested a review January 24, 2022 03:48
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

@lightClouds917 lightClouds917 changed the title optimize acquire global lock fail error log print on tc optimize: acquire global lock fail error log print on tc Jan 25, 2022
@@ -272,8 +272,13 @@ private boolean acquireLockByLua(Jedis jedis, List<RowLock> rowLocks) {
args.add(lockKeysString.toString());
// reset args index 2
args.set(1, String.valueOf(args.size()));
long result = (long)jedis.evalsha(ACQUIRE_LOCK_SHA, keys, args);
return SUCCEED == result;
String xIdOwnLock = (String) jedis.evalsha(ACQUIRE_LOCK_SHA, keys, args);
Copy link
Contributor

@funky-eyes funky-eyes Feb 9, 2022

Choose a reason for hiding this comment

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

刚才看漏了,在196行那里也要做处理

Copy link
Contributor Author

Choose a reason for hiding this comment

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

现在是这样的,redis存储,lua模式和pipeline模式都打印这样的日志

20:58:10.287  INFO --- [rverHandlerThread_1_9_500] i.s.s.storage.redis.lock.RedisLocker     : tx:[192.168.121.1:8091:2576290387922075649] acquire Global lock failed. Global lock on [SEATA_ROW_LOCK_jdbc:mysql://localhost:3306/seata_stock^^^product^^^1] is holding by xid 192.168.121.1:8091:2576290387922075651
20:58:10.287  INFO --- [rverHandlerThread_1_9_500] i.s.c.e.AbstractExceptionHandler         : this request cannot acquire global lock, you can let Seata retry by setting config [client.rm.lock.retryPolicyBranchRollbackOnConflict] = false or manually retry by yourself. request: xid=192.168.121.1:8091:2576290387922075649,branchType=AT,resourceId=jdbc:mysql://localhost:3306/seata_stock,lockKey=product:1

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.

就这个问题了,改一下我这里就没问题了

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

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

@lightClouds917 lightClouds917 merged commit fccd58f into apache:develop Feb 24, 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.

优化 Global lock acquire failed 异常打印 optimize Global lock acquire failed Exception print in log
6 participants