-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix persistent lock retrieval by path #33888
Conversation
72ee8e5
to
8d8734a
Compare
@DeepDiver1975 please carefully review. I added a lot of comments in the code to clarify the tested scenarios and the SQL query. Seems there were a few more bugs in there which I fixed (see PR description for detail) |
lib/private/Lock/Persistent/Lock.php
Outdated
@@ -39,6 +39,9 @@ | |||
*/ | |||
class Lock extends Entity implements ILock { | |||
|
|||
const DEPTH_ZERO = 0; |
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 seems I missed that this is already on ILock
will change after the first review pass
) | ||
); | ||
} | ||
|
||
return $this->findEntities($query->getSQL(), $query->getParameters()); | ||
$query->andWhere($pathMatchClauses); |
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.
I should probably also add "ORDER BY" as some databases will mess up the order and break the tests...
Order by path ?
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, fix the unit test instead
|
|
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.
Looks good - THX .. adjust remaining topics as discussed .... 👍
8d8734a
to
8daf011
Compare
Adjusted. Now hoping Oracle will pass... |
Codecov Report
@@ Coverage Diff @@
## master #33888 +/- ##
============================================
- Coverage 64.76% 64.47% -0.29%
+ Complexity 18336 18334 -2
============================================
Files 1198 1198
Lines 69401 69397 -4
Branches 1276 1276
============================================
- Hits 44948 44746 -202
- Misses 24084 24279 +195
- Partials 369 372 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #33888 +/- ##
============================================
+ Coverage 64.76% 64.77% +<.01%
- Complexity 18336 18340 +4
============================================
Files 1198 1198
Lines 69403 69418 +15
Branches 1276 1276
============================================
+ Hits 44950 44964 +14
- Misses 24084 24085 +1
Partials 369 369
Continue to review full report at Codecov.
|
Oracle fail:
|
acceptance test, something weird:
|
seems the id with Oracle is shifted. it almost looks like the insert id that was returned does not match the actual one returned by subsequent select |
8daf011
to
030233b
Compare
now sorting by id instead of fileid, let's see... |
maybe the "testing" app did not enable for some reason?? @phil-davis @individual-it |
After PR #33956 has been merged to |
Fix query to make it strictly search in the given storage.. Fix query to prevent LIKE bleeding into unrelated folders (trailing slash issue). Added enforcement of Depth 0 or -1 as per RFC 4918 Section 9.10.3. Added many more unit tests to test the query from different angles, making sure that locks from parent and child paths are returned when the correct conditions are met and also not returned when not met. Reenable matching acceptance test
030233b
to
0f87cf0
Compare
Rebased. Fixed Oracle by properly sorting the expected output before asserting... |
stable10: #33957 |
Removed backport-request label because backport is done. |
Description
Related Issue
Fixes #33885
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: