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

Multiple concurrent writers (and readers) with shared NFS mount #86

Open
matthewcummings opened this issue Dec 5, 2021 · 6 comments
Open
Labels
bug complex issue question stale Issues and PRs that seem abandoned by their authors.

Comments

@matthewcummings
Copy link

I'm seeing an issue with cachier where I'm getting Bad File Descriptor errors. Just want to make sure I'm not completely abusing it here, I have multiple writers (and readers) accessing a shared cache directory via NFS.

Am I way off the mark here for thinking this would ever work correctly?

@shaypal5
Copy link
Collaborator

shaypal5 commented Dec 6, 2021

Hmmm. Honestly no idea.

Isn't NFS should technically make the software layer "feel" as if it's just accessing the file system? I really lack the deep OS/kernel/filesystem knowledge required to answer this.

Each cachier wrapper gets its own cache file (when using the pickle core) and just acquires and releases a lock to read/write to the file. Specifically, since by cachier also holds the cache in-memory, you can have it not reload the cache from file on every call (with @cachier(pickle_reload=False)), which doesn't effect relevancy of results if you run single threaded, but can mean different threads might get stale results if you run multi-threaded.

Also, the separate_files=True option makes the cache use a separate file for each argument set, so each function uses numerous files. Better for larger results, and might help in your case, if indeed different readers and writers use different argument sets to the same function. Might.

But then, Bad File Descriptor doesn't sound like it has to do with locking. On the other hand, I don't know. :)

Do you get it sporadically, or consistently?

@matthewcummings
Copy link
Author

Consistently, it could be a bug in my code too. Mostly I wanted to confirm that this should work.
Thank you

@shaypal5
Copy link
Collaborator

shaypal5 commented Dec 8, 2021

Cool. Please let me know how it goes. It will help me help you if I understand the use case better; e.g. do all readers and writers use the same function or not, etc.

@matthewcummings
Copy link
Author

Will do, thank you.

@shaypal5
Copy link
Collaborator

shaypal5 commented Jan 9, 2022

Any news on that? @matthewcummings

@shaypal5
Copy link
Collaborator

shaypal5 commented Dec 5, 2023

Note to all interested parties:
There is a possibly related issue here:
#128

And if portalocker is indeed the culprit then this might be the relevant issue on their repository:
wolph/portalocker#92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug complex issue question stale Issues and PRs that seem abandoned by their authors.
Projects
None yet
Development

No branches or pull requests

2 participants