Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redis-3366253
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
redis-3366253
Commits
40e909f1
Commit
40e909f1
authored
12 years ago
by
pounard
Browse files
Options
Downloads
Patches
Plain Diff
#1513942
- found by David Strauss - Multiple fixes in both lock backends
parent
d77f459c
Branches
7.x-1.x
Tags
7.x-1.0-alpha7
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Redis/Lock/Backend/PhpRedis.php
+2
-2
2 additions, 2 deletions
lib/Redis/Lock/Backend/PhpRedis.php
lib/Redis/Lock/Backend/Predis.php
+2
-2
2 additions, 2 deletions
lib/Redis/Lock/Backend/Predis.php
with
4 additions
and
4 deletions
lib/Redis/Lock/Backend/PhpRedis.php
+
2
−
2
View file @
40e909f1
...
...
@@ -44,7 +44,7 @@ class Redis_Lock_Backend_PhpRedis extends Redis_Lock_Backend_Default {
return
FALSE
;
}
return
TRUE
;
return
(
$this
->
_locks
[
$name
]
=
TRUE
)
;
}
else
{
$client
->
watch
(
$key
);
...
...
@@ -81,7 +81,7 @@ class Redis_Lock_Backend_PhpRedis extends Redis_Lock_Backend_Default {
list
(
$value
,
$owner
)
=
$client
->
mget
(
array
(
$key
,
$key
.
':owner'
));
return
(
FALSE
!
==
$value
||
0
==
$value
)
&&
$id
==
$owner
;
return
FALSE
=
==
$value
||
$id
==
$owner
;
}
public
function
lockRelease
(
$name
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/Redis/Lock/Backend/Predis.php
+
2
−
2
View file @
40e909f1
...
...
@@ -75,7 +75,7 @@ class Redis_Lock_Backend_Predis extends Redis_Lock_Backend_Default {
// case in which we cannot proceed.
// EXPIRE and SETEX won't return something here, EXEC return is index 2.
// This was determined debugging, seems to be Predis specific.
if
(
FALSE
===
$execReply
[
2
]
||
1
!=
$execReply
[
1
])
{
if
(
FALSE
===
$execReply
[
2
]
||
1
!=
$execReply
[
0
])
{
return
FALSE
;
}
...
...
@@ -93,7 +93,7 @@ class Redis_Lock_Backend_Predis extends Redis_Lock_Backend_Default {
list
(
$value
,
$owner
)
=
$client
->
mget
(
array
(
$key
,
$key
.
':owner'
));
return
(
FALSE
!==
$value
||
0
==
$value
)
&&
$id
==
$owner
;
return
empty
(
$value
)
||
$id
==
$owner
;
}
public
function
lockRelease
(
$name
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment