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

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

Closed
PVince81 opened this issue Jun 17, 2015 · 6 comments
Closed

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

PVince81 opened this issue Jun 17, 2015 · 6 comments

Comments

@PVince81
Copy link
Contributor

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" ?

@PVince81 PVince81 added this to the 8.1-current milestone Jun 17, 2015
@PVince81
Copy link
Contributor Author

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

@icewind1991
Copy link
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.

@PVince81
Copy link
Contributor Author

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
Copy link
Contributor

But beware of overwrites.

Wont happen due to locking

@PVince81
Copy link
Contributor Author

This PR fixes it #16963

@PVince81
Copy link
Contributor Author

Fixed by #16963

@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