Open masariello opened 8 months ago
Hey @masariello, this probably isn't something that'll get resolved in the next few weeks. But we do have tentative plans to rework the caching anyway due to an upcoming project on this SDK
Is this actually affecting you, outside of causing trouble in the logs? Writing to backup, shouldn't be a process that needs to happen to ensure the SDK works correctly
Yes. I hit the problem reproduced in the linked fcache issues
In fact, fcache has numerous issues when running with multiprocessing. It just opens and writes files on disk without any locking or retry logic, so every now and then we do get exceptions caused by those concurrent accesses.
The only way to avoid those issues is replacing fcache with a dict-based BaseCache
As an extra motivation, fcache also isn't compatible with many serverless environments out-of-the-box.
For example, in AWS lambda, the home directory is mounted on a read-only file system and fcache defaults to $HOME/.cache/
as the base path for cache files. This can be worked around by setting XDG_CACHE_HOME
to something like /tmp/cache/
, but it makes this package slightly more cumbersome to use in a serverless deployment.
Describe the bug
fcache has a known issue with multiprocessing (tsroten/fcache#26) that has been ignored tor 5 years.
Here's an example of the errors
To Reproduce
Please see StackOverflow linked in tsroten/fcache#26