-
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
bugfix: fix jedis unlock fail #2897
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2897 +/- ##
=============================================
- Coverage 50.27% 50.27% -0.01%
- Complexity 3047 3049 +2
=============================================
Files 599 599
Lines 19410 19415 +5
Branches 2381 2381
=============================================
+ Hits 9758 9760 +2
- Misses 8674 8679 +5
+ Partials 978 976 -2
|
@@ -144,6 +144,7 @@ public boolean releaseLock(String xid, List<Long> branchIds) { | |||
if (CollectionUtils.isNotEmpty(keys)) { | |||
Pipeline pipeline = null; | |||
Iterator<String> it = keys.iterator(); | |||
List<String> delKeys = new ArrayList<>(); | |||
while (it.hasNext()) { | |||
String key = it.next(); | |||
LockDO lock = JSON.parseObject(jedis.get(key), LockDO.class); |
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.
It can be changed to mget
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.
ok
@@ -152,13 +153,15 @@ public boolean releaseLock(String xid, List<Long> branchIds) { | |||
if (pipeline == null) { | |||
pipeline = jedis.pipelined(); | |||
} |
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.
It can be deleted and the following with delKeys judgment
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.
ok
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.
What is the meaning of logQueryLimit?
relieve redis query pressure? If so, why not delete in batches? Will memory be OOM?
|
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
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
fix jedis unlock fail
Ⅱ. Does this pull request fix one issue?
fix #2898
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews