You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this is what happens when a file is locked.
So either the test isn't supposed to lock, maybe there's a stray lock.
Or the test is doing stuff in parallel and it triggers the new locking logic.
I locally ran t1.pl and also t4.pl (which is the one that contains "test_ignored") and the tests passed.
Ran them several times and they worked fine.
So it's possibly a race condition of some sorts...
I also noticed with redis-cli and the KEYS * command that after the test run there are quite a few stray keys.
After t1.pl: 32 stray keys
After t4.pl: 19 stray keys
Leaking keys could be an explanation for the failing test on Jenkins.
I will try every possible file operation and find out which one is leaking keys.
Here is a list of file operations and how many keys are left in redis after doing them:
(keys are cleared with the FLUSHALL command between runs)
web UI
create file: 3
create folder: 2
upload file: 7
delete file: 6
delete folder: 4
download file: 2
display file list: 1 (it seems to recreate a preview over and over again for some reason ?)
WebDAV
create folder: 2
upload file: 2
delete file: 7
delete folder: 4
download file: 2
propfind: 0
For operations that use fopen(), I can understand that the keys aren't released until later due to the fclose() detection that happens only at GC time. I'm not sure why other operations like creating a folder would leak keys.
t1.pl: 32 stray keys, after more than 5 minutes, the keys are still there.
If I restart Apache2, hoping to force GC, but the keys are still there.
That's bad.
TODO: test with apcu => ran t1.pl then t4.pl, no errors
TODO: unobfuscate key names (they are md5) to find out what paths are still locked
Is the APCu cache cleared between test runs ?
I suppose that Jenkins is running all the t*.pl tests in order ?
Maybe one of the previous tests is leaving something locked.
Ran all the csync tests locally in order, with APCu and redis. They all passed.
After that I dumped the redis DB and can confirm that all keys were set to "0" as @icewind1991 said.
@DeepDiver1975 if APCu isn't cleant up and the tests are running since the PR existed and evolved over several commits, maybe there's a key that got stuck at that moment due to broken/old code ?
@DeepDiver1975 if APCu isn't cleant up and the tests are running since the PR existed and evolved over several commits, maybe there's a key that got stuck at that moment due to broken/old code ?
let me kill the instance and install from scratch - this will generate a new instance id and result in a clean apc cache .....
I don't remember seeing any TTL logic in the locking providers. @icewind1991 ?
Might need to call "setTimeout()" on the keys every time we touch them to refresh the timeout.
@icewind1991 can you add the TTL ? I saw in the redis API that it should be possible to set a timeout on lock keys. Let's keep this ticket open for that.
What do we want to do with the other memcache backends? from what I can tell not all of them have the ability to set the ttl separately and most of them don't handle ttl the way we want with inc/dec
Hmmm, it means that for other backends we would need to implement the timeout logic ourselves. One possibility would be to add the lock time inside the value.
And then for every lock operation, we'd need to check the time first... and potentially lose atomicity.
Activity
DeepDiver1975 commentedon Jun 8, 2015
@PVince81 @icewind1991 @dragotin we need combined forces here - THX
PVince81 commentedon Jun 8, 2015
Yes, this is what happens when a file is locked.
So either the test isn't supposed to lock, maybe there's a stray lock.
Or the test is doing stuff in parallel and it triggers the new locking logic.
PVince81 commentedon Jun 8, 2015
@DeepDiver1975 where is the source code for those csync tests ?
DeepDiver1975 commentedon Jun 8, 2015
https://github.com/owncloud/client/tree/master/csync/tests/ownCloud
PVince81 commentedon Jun 8, 2015
I locally ran t1.pl and also t4.pl (which is the one that contains "test_ignored") and the tests passed.
Ran them several times and they worked fine.
So it's possibly a race condition of some sorts...
I also noticed with redis-cli and the
KEYS *command that after the test run there are quite a few stray keys.After t1.pl: 32 stray keys
After t4.pl: 19 stray keys
Leaking keys could be an explanation for the failing test on Jenkins.
I will try every possible file operation and find out which one is leaking keys.
PVince81 commentedon Jun 8, 2015
Here is a list of file operations and how many keys are left in redis after doing them:
(keys are cleared with the
FLUSHALLcommand between runs)web UI
WebDAV
For operations that use fopen(), I can understand that the keys aren't released until later due to the fclose() detection that happens only at GC time. I'm not sure why other operations like creating a folder would leak keys.
Any idea @icewind1991 ?
I'll redo a test run with t1.pl and check whether the keys auto-expire after a while.
DeepDiver1975 commentedon Jun 8, 2015
FYI: I'm using apcu on that test server as lock storage
PVince81 commentedon Jun 8, 2015
We might want to run these tests on redis on Jenkins instead, which we agreed would be the recommended approach, at least for the beginning.
I'll try with apcu later.
DeepDiver1975 commentedon Jun 8, 2015
I'm very much aware of this - the test server runs some old suse - I doubt we have redis at hand ... easily
PVince81 commentedon Jun 8, 2015
t1.pl: 32 stray keys, after more than 5 minutes, the keys are still there.
If I restart Apache2, hoping to force GC, but the keys are still there.
That's bad.
PVince81 commentedon Jun 8, 2015
Is the APCu cache cleared between test runs ?
I suppose that Jenkins is running all the t*.pl tests in order ?
Maybe one of the previous tests is leaving something locked.
DeepDiver1975 commentedon Jun 8, 2015
No - pure random execution - can even be selective (what I do in case of one test failing)
10 remaining items
PVince81 commentedon Jun 8, 2015
Ran all the csync tests locally in order, with APCu and redis. They all passed.
After that I dumped the redis DB and can confirm that all keys were set to "0" as @icewind1991 said.
PVince81 commentedon Jun 8, 2015
@DeepDiver1975 if APCu isn't cleant up and the tests are running since the PR existed and evolved over several commits, maybe there's a key that got stuck at that moment due to broken/old code ?
icewind1991 commentedon Jun 8, 2015
#16800 for cleaning up keys
PVince81 commentedon Jun 8, 2015
@icewind1991 thanks
DeepDiver1975 commentedon Jun 8, 2015
let me kill the instance and install from scratch - this will generate a new instance id and result in a clean apc cache .....
.... wait - what is the TTL for our locks?
PVince81 commentedon Jun 8, 2015
I don't remember seeing any TTL logic in the locking providers. @icewind1991 ?
Might need to call "setTimeout()" on the keys every time we touch them to refresh the timeout.
DeepDiver1975 commentedon Jun 8, 2015
hmmm . didn't we initially talk about a TTL? Locks cannot stay forever
PVince81 commentedon Jun 8, 2015
Yes, still an open todo it seems: #11804 (comment)
PVince81 commentedon Jun 12, 2015
@icewind1991 can you add the TTL ? I saw in the redis API that it should be possible to set a timeout on lock keys. Let's keep this ticket open for that.
icewind1991 commentedon Jun 12, 2015
What do we want to do with the other memcache backends? from what I can tell not all of them have the ability to set the ttl separately and most of them don't handle ttl the way we want with inc/dec
PVince81 commentedon Jun 12, 2015
Hmmm, it means that for other backends we would need to implement the timeout logic ourselves. One possibility would be to add the lock time inside the value.
And then for every lock operation, we'd need to check the time first... and potentially lose atomicity.
DeepDiver1975 commentedon Jun 16, 2015
all green now -> close - THX
PVince81 commentedon Jun 16, 2015
Raised #16966 for the TTL discussion (please schedule accordingly)