Hello,

I have recently come across a case where the _read_cache() function calls it's self so many times the nesting level is reached.

I tried to rebuild the table with s3fs-refresh-cache but this failed as well with about 2 million files in S3.

Here's a patch that solves both problems for me so may be useful for someone else as well.

Comments

TomGould01 created an issue. See original summary.

TomGould01’s picture

StatusFileSize
new5.24 KB
coredumperror’s picture

StatusFileSize
new839 bytes

Looking at your patch to the _read_cache() function, it looks like it actually breaks the anti-stampede code for every future cache read after 10 failed attempts to acquire the lock for a single file. Probably not the best solution.

In the attached patch, I've re-coded the recursive call into a goto. Could you try that out to see if it works? I've never actually used a goto before, since it's considered such a bad practice. But it seems like this is exactly the kind of situation it would actually be useful for.

Though as I look further into this, I'm really not sure why you'd be having this recursion problem at all. The lock that _read_cache() acquires applies only to a single file, so I'm not really sure what circumstances would even be able to repeatedly trigger the !lock_acquire($cid, 1) condition. Could you please describe what you (or some script) were doing when this recursion problem occurred?

For the cache refresh patch, I'm not really sure what it's doing. What "integrity constraint issues" are you testing for, and how is your code dealing with them?

coredumperror’s picture

Did you ever solve your problem with this issue? Please let me know yes, or no, so I can either close this issue or continue to work toward a solution.

kenorb’s picture

Status: Active » Needs review
kenorb’s picture

Assigned: TomGould01 » Unassigned
cmlara’s picture

Status: Needs review » Closed (outdated)

Drupal 7 end-of-life triage:
Drupal 7 reached end of life on January 5th.

The 7.x branches of S3FS do not have any additional planned releases.

The requests in this issue do not appear to exist in the 8.x-3.x and newer branches.