-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
The head ref may contain hidden characters: "develop_\u4F18\u5316server\u7AEF\u5168\u5C40\u9501\u5931\u8D25\u65E5\u5FD7\u6253\u5370"
optimize: acquire global lock fail error log print on tc #4305
Conversation
b5cd45f
to
4621cec
Compare
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ 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
|
…chio2018/seata into 优化server端全局锁失败日志打印_local
…chio2018/seata into 优化server端全局锁失败日志打印_local � Conflicts: � changes/en-us/1.5.0.md
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Show resolved
Hide resolved
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
… develop_优化server端全局锁失败日志打印
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
刚才看漏了,在196行那里也要做处理
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就这个问题了,改一下我这里就没问题了
core/src/main/java/io/seata/core/exception/AbstractExceptionHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. 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
Ⅴ. Special notes for reviews