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

Regression with locking since "keep a read lock while scanning a file or folder" #17018

Closed
nickvergessen opened this issue Jun 18, 2015 · 5 comments

Comments

@nickvergessen
Copy link
Contributor

Since 7d72f7d from #16729 the smashbox tests do not work anymore:

{
    "reqId": "I3hWry8nnAyvXGgnQm5D",
    "remoteAddr": "127.0.0.1",
    "app": "webdav",
    "message": {
        "Exception": {
            "Message": "\"files/8efc3f3232c0748d7ee645e4aa7c7325\" is locked",
            "Code": 0,
            "Trace": {
                "#0": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/common.php(633): OC\Lock\MemcacheLockingProvider->acquireLock('files/8efc3f323...', 1)",
                    null
                ],
                "#1": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/wrapper.php(553): OC\Files\Storage\Common->acquireLock('files/TEST_FILE...', 1, Object(OC\Lock\MemcacheLockingProvider))",
                    null
                ],
                "#2": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/wrapper.php(553): OC\Files\Storage\Wrapper\Wrapper->acquireLock('files/TEST_FILE...', 1, Object(OC\Lock\MemcacheLockingProvider))",
                    null
                ],
                "#3": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/cache/scanner.php(133): OC\Files\Storage\Wrapper\Wrapper->acquireLock('files/TEST_FILE...', 1, Object(OC\Lock\MemcacheLockingProvider))",
                    null
                ],
                "#4": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/cache/watcher.php(93):",
                    "OC\Files\Cache\Scanner->scanFile('files/TEST_FILE...')"
                ],
                "#5": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/view.php(1171): OC\Files\Cache\Watcher->checkUpdate('files/TEST_FILE...', Array)",
                    null
                ],
                "#6": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/share/share.php(131):",
                    "OC\Files\View->getFileInfo('/TEST_FILE_MODI...')"
                ],
                "#7": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/public/share.php(88): OC\Share\Share::getUsersSharingFile('/TEST_FILE_MODI...', 'test1', false, false)",
                    null
                ],
                "#8": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/encryption/file.php(57): OCP\Share::getUsersSharingFile('/TEST_FILE_MODI...', 'test1')",
                    null
                ],
                "#9": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/stream/encryption.php(246):",
                    "OC\Encryption\File->getAccessList('/test1/files/TE...')"
                ],
                "#10": [
                    "[internal function]: OC\Files\Stream\Encryption->stream_open('ocencryption://', 'w', 0, NULL)",
                    null
                ],
                "#11": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/stream/encryption.php(187): fopen('ocencryption://', 'w', false, Resource id #75)",
                    null
                ],
                "#12": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/stream/encryption.php(169): OC\Files\Stream\Encryption::wrapSource(Resource id #74, 'w', Resource id #75, 'ocencryption', 'OC\\Files\\Stream...')",
                    null
                ],
                "#13": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/encryption.php(411): OC\Files\Stream\Encryption::wrap(Resource id #74, 'files/TEST_FILE...', '/test1/files/TE...', Array, 'test3', Object(OCA\Encryption\Crypto\Encryption), Object(OC\Files\Storage\Home), Object(OC\Files\Storage\Wrapper\Encryption), Object(OC\Encryption\Util), Object(OC\Encryption\File), 'w', 21576, 10000, 8192)",
                    null
                ],
                "#14": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/encryption.php(501): OC\Files\Storage\Wrapper\Encryption->fopen('files/TEST_FILE...', 'w')",
                    null
                ],
                "#15": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/encryption.php(435): OC\Files\Storage\Wrapper\Encryption->copyBetweenStorage(Object(OCA\Files_Trashbin\Storage), 'files/TEST_FILE...', 'files/TEST_FILE...', true, true)",
                    null
                ],
                "#16": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/wrapper.php(535): OC\Files\Storage\Wrapper\Encryption->moveFromStorage(Object(OCA\Files_Trashbin\Storage), 'files/TEST_FILE...', 'files/TEST_FILE...')",
                    null
                ],
                "#17": [
                    "/home/nickv/ownCloud/Smashbox/master/apps/files_sharing/lib/sharedstorage.php(612): OC\Files\Storage\Wrapper\Wrapper->moveFromStorage(Object(OCA\Files_Trashbin\Storage), 'files/TEST_FILE...', 'files/TEST_FILE...')",
                    null
                ],
                "#18": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/files/storage/wrapper/wrapper.php(535): OC\Files\Storage\Shared->moveFromStorage(Object(OCA\Files_Trashbin\Storage), 'files/TEST_FILE...', '')",
                    null
                ],
                "#19": [
                    "/home/nickv/ownCloud/Smashbox/master/lib/private/connector/sabre/file.php(205): OC\Files\Storage\Wrapper\Wrapper->moveFromStorage(Object(OCA\Files_Trashbin\Storage), 'files/TEST_FILE...', '')",
                    null
                ],
                "#20": [
                    "/home/nickv/ownCloud/Smashbox/master/3rdparty/sabre/dav/lib/DAV/Server.php(1087): OC\Connector\Sabre\File->put(Resource id #23)",
                    null
                ],
                "#21": [
                    "/home/nickv/ownCloud/Smashbox/master/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(501): Sabre\DAV\Server->updateFile('TEST_FILE_MODIF...', Resource id #23, NULL)",
                    null
                ],
                "#22": [
                    "[internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))",
                    null
                ],
                "#23": [
                    "/home/nickv/ownCloud/Smashbox/master/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)",
                    null
                ],
                "#24": [
                    "/home/nickv/ownCloud/Smashbox/master/3rdparty/sabre/dav/lib/DAV/Server.php(469): Sabre\Event\EventEmitter->emit('method:PUT', Array)",
                    null
                ],
                "#25": [
                    "/home/nickv/ownCloud/Smashbox/master/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))",
                    null
                ],
                "#26": [
                    "/home/nickv/ownCloud/Smashbox/master/apps/files/appinfo/remote.php(83):",
                    "Sabre\DAV\Server->exec()"
                ],
                "#27": [
                    "/home/nickv/ownCloud/Smashbox/master/remote.php(84):",
                    "require_once('/home/nickv/own...')"
                ],
                "#28": [
                    "{main}",
                    null
                ]
            },
            "File": "/home/nickv/ownCloud/Smashbox/master/lib/private/lock/memcachelockingprovider.php",
            "Line": 70
        }
    },
    "level": 4,
    "time": "2015-06-18T12:32:37+00:00"
}

What the test does:

+-----------+-----------------+------------------+------------------+--------------+
|  Step     |  Sharer         |  Sharee One      |  Sharee Two      |  Admin       |
|  Number   |                 |  (not in group)  |  (in group)      |              |
+===========+======================+==================+============================|
|  2        | create work dir | create work dir  |  create work dir |              |
+-----------+-----------------+------------------+------------------+--------------+
|  3        | Create test     |                  |                  |              |
|           | files and dir   |                  |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  4        | Shares files    |                  |                  |              |
|           | with group      |                  |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  5        |                 | Syncs and        | Syncs and        |              |
|           |                 | validates files  | validates files  |              |
|           |                 | do not exist     | exist            |              |
+-----------+-----------------+------------------+------------------+--------------+
|  6        |                 |                  | Modifies one     |              |
|           |                 |                  | file, if allowed |              |
+-----------+-----------------+------------------+------------------+--------------+
|  7        | Validates       |                  |                  |              |
|           | file modified   |                  |                  |              |
|           | or not,         |                  |                  |              |
|           | based on        |                  |                  |              |
|           | permissions     |                  |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  8        |                 |                  |  Shares a file   |              |
|           |                 |                  |  with sharee one |              |
|           |                 |                  |  if permitted    |              |
+-----------+-----------------+------------------+------------------+--------------+
|  9        |                 | Syncs and        |                  |              |
|           |                 | validates file   |                  |              |
|           |                 | is shared if     |                  |              |
|           |                 | permitted        |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  10       | Sharer unshares |                  |                  |              |
|           | a file          |                  |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  11       |                 | Syncs and        | Syncs and        |              |
|           |                 | validates file   | validates file   |              |
|           |                 | not present      | not present      |              |
+-----------+-----------------+------------------+------------------+--------------+
|  12       | Sharer deletes  |                  |                  |              |
|           | a file          |                  |                  |              |
+-----------+-----------------+------------------+------------------+--------------+
|  13       |                 | Syncs and        |  Syncs and       |              |
|           |                 | validates file   |  validates file  |              |
|           |                 | not present      |  not present     |              |
+-----------+-----------------+------------------+------------------+--------------+
| 14        |                 |                  |                  | Removes user |
|           |                 |                  |                  | from Group   |
+-----------+-----------------+------------------+------------------+--------------+
| 15        |                 |                  |  Syncs and       |              |
|           |                 |                  |  verifies file   |              |
|           |                 |                  |  not present     |              |
+-----------+-----------------+------------------+------------------+--------------+
| 16        | Final step      | Final step       |  Final Step      | Final Step   |
+-----------+-----------------+------------------+------------------+--------------+

The exception is thrown in step 6, so when Sharee Two (user in the group the item is shared with) tries to upload (via client, so webdav) his edited version of the file.

@nickvergessen
Copy link
Contributor Author

@PVince81
Copy link
Contributor

Possible duplicate of #16998

@PVince81
Copy link
Contributor

Let's first merge #16963 and #17017 and then retry the tests

@nickvergessen
Copy link
Contributor Author

#16963 is enought to make tests pass again.
Will retry with both merged as well now

@nickvergessen
Copy link
Contributor Author

Merged #17017 as well and it still works (assuming #16963 is already there)

@lock lock bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants