Repository navigation
Closed
Milestone
Description
Steps
- Enable exp file locking with redis
- Using cadaver, PUT a file "bacon.txt" in the root
- Add
sleep(30)here https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/file.php#L205 before the final rename after upload - PUT the file "bacon.txt" again
- 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
PVince81 commentedon Jun 17, 2015
Regression introduced by the scanner PR regarding locking: #16729 (comment)
icewind1991 commentedon Jun 17, 2015
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.
PVince81 commentedon Jun 17, 2015
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.
icewind1991 commentedon Jun 17, 2015
Wont happen due to locking
PVince81 commentedon Jun 18, 2015
This PR fixes it #16963
PVince81 commentedon Jun 22, 2015
Fixed by #16963