Core: Retry lock acquiring after delay

Created on 18 Jun 2015  路  8Comments  路  Source: owncloud/core

Like for the old files_locking app, we might want to add a wait loop + delay when acquiring a lock.
Basically if the lock is not available, wait a few milliseconds and try again.

A bit like https://github.com/owncloud/files_locking/blob/master/lib/lock.php#L105

@icewind1991 @DeepDiver1975 @nickvergessen

Bug locking statuSTALE

Most helpful comment

In some cases, background jobs that do filesystem operations might lock some folders during their operation. If someone is uploading a huge file, that one will likely fail with 423 Locked.

In fact, it happened to me recently: I uploaded a new 1.5 GB file through Webdav and it took several hours (because my upload speed here sucks...). When it finally reached the final bytes, it failed with 423 Locked.
When looking at the log it appears that some cron jobs were running around the same time.

Especially for such scenarios it would be useful to have a "wait and retry" logic when acquiring locks. If after a specific timeout the lock is still not free, return the 423 Locked error.

@DeepDiver1975 @butonic @guruz @ogoffart @davivel @dragotin does that make sense ?

All 8 comments

I'm pretty sure there must be a duplicate but I can't find it now...

In some cases, background jobs that do filesystem operations might lock some folders during their operation. If someone is uploading a huge file, that one will likely fail with 423 Locked.

In fact, it happened to me recently: I uploaded a new 1.5 GB file through Webdav and it took several hours (because my upload speed here sucks...). When it finally reached the final bytes, it failed with 423 Locked.
When looking at the log it appears that some cron jobs were running around the same time.

Especially for such scenarios it would be useful to have a "wait and retry" logic when acquiring locks. If after a specific timeout the lock is still not free, return the 423 Locked error.

@DeepDiver1975 @butonic @guruz @ogoffart @davivel @dragotin does that make sense ?

I was just tired of this and went ahead implementing it here: https://github.com/owncloud/core/pull/28544

Also this is a potential topic for https://github.com/owncloud/core/pull/28253#issuecomment-319058642 but I'm not sure if we should backport this...

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

While my experiment failed, we still need a way.

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

Please implement this. I get this with demo.owncloud.com in the root directory when uploading a big file (using a single WebDAV PUT, no oC chunking) to remotes.php/wedav.

I don't know the cause or who locked something. Is it related to me using no chunking?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

f-s picture f-s  路  4Comments

HLeemans picture HLeemans  路  4Comments

tommis picture tommis  路  5Comments

michaelstingl picture michaelstingl  路  3Comments

j-holub picture j-holub  路  3Comments