Skip to content

Cannot browse web UI, locked, during concurrent upload #16998

Closed

Description

@PVince81

Steps

  1. Enable exp file locking with redis
  2. Using cadaver, PUT a file "bacon.txt" in the root
  3. Add sleep(30) here https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/file.php#L205 before the final rename after upload
  4. PUT the file "bacon.txt" again
  5. Try browsing the root folder in the web UI during the upload

Expected result

Root is browseable

Actual result

Internal server error

{"reqId":"mokcGayHlQ15XQiJB2ex","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Exception\":\"OCP\\\\Lock\\\\LockedException\",\"Message\":\"\\\"files\\\/c80d6549defed94752fa783bebb76dae\\\" is locked\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(633): OC\\\\Lock\\\\MemcacheLockingProvider->acquireLock('files\\\/c80d6549d...', 1)\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(553): OC\\\\Files\\\\Storage\\\\Common->acquireLock('files\\\/bacon.txt', 1, Object(OC\\\\Lock\\\\MemcacheLockingProvider))\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(553): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('files\\\/bacon.txt', 1, Object(OC\\\\Lock\\\\MemcacheLockingProvider))\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/scanner.php(133): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('files\\\/bacon.txt', 1, Object(OC\\\\Lock\\\\MemcacheLockingProvider))\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/scanner.php(331): OC\\\\Files\\\\Cache\\\\Scanner->scanFile('files\\\/bacon.txt', 3, 2, Array)\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/scanner.php(257): OC\\\\Files\\\\Cache\\\\Scanner->scanChildren('files', false, 3, Array)\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/watcher.php(91): OC\\\\Files\\\\Cache\\\\Scanner->scan('files', false)\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1171): OC\\\\Files\\\\Cache\\\\Watcher->checkUpdate('files', Array)\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(861): OC\\\\Files\\\\View->getFileInfo('\\\/', false)\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files\\\/index.php(84): OC\\\\Files\\\\Filesystem::getFileInfo('\\\/', false)\\n#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(153) : runtime-created function(1): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#11 [internal function]: __lambda_func(Array)\\n#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(274): call_user_func('\\\\x00lambda_216', Array)\\n#13 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(867): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/')\\n#14 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(40): OC::handleRequest()\\n#15 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/lock\\\/memcachelockingprovider.php\",\"Line\":70}","level":4,"time":"2015-06-17T15:41:36+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/"}

Happens on latest master (bfa716a)

@icewind1991 seems one of the locks is too "strong" ?

Activity

  1. added this to the milestone on Jun 17, 2015
  2. PVince81 commented on Jun 17, 2015

    @PVince81
    ContributorAuthor

    Regression introduced by the scanner PR regarding locking: #16729 (comment)

  3. icewind1991 commented on Jun 17, 2015

    @icewind1991
    Contributor

    @icewind1991 seems one of the locks is too "strong" ?

    Not to strong, it's locked since it can't scan the newly created file.

    What is the exact expected behavior? having the root folder without the new file in it?

    We could catch the locked exception in the cache watcher and return the existing (slightly outdated) cache data of the folder.

  4. PVince81 commented on Jun 17, 2015

    @PVince81
    ContributorAuthor

    Hmmm good point.
    On the one hand I'd say show the file but downloading it fails because of the lock.
    But then if we don't know how big it is, what size do we show ? 0 ?

    Not showing it might be fine too. But beware of overwrites. Might be easier to always show it.

  5. icewind1991 commented on Jun 17, 2015

    @icewind1991
    Contributor

    But beware of overwrites.

    Wont happen due to locking

  6. PVince81 commented on Jun 18, 2015

    @PVince81
    ContributorAuthor

    This PR fixes it #16963

  7. PVince81 commented on Jun 22, 2015

    @PVince81
    ContributorAuthor

    Fixed by #16963

  8. locked as resolved and limited conversation to collaborators on Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions