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

Spawning threads in handlers? #37

Closed
riaqn opened this issue Dec 20, 2020 · 3 comments
Closed

Spawning threads in handlers? #37

riaqn opened this issue Dec 20, 2020 · 3 comments

Comments

@riaqn
Copy link

riaqn commented Dec 20, 2020

I want to have a thread tracking the access of a file: it's spawned when the file is opened, and canceled when the file is closed. I read the trio document and it seems I need to use nursery. It seems that I will need the pyfuse3 framework to pass a nursery object to my handler functions which can then use the nursery to spawn threads? Am I understanding it right?

Alternatively of course I can just use asyncio. But I'm having some issues with it (namely some exceptions are missing) so I'm trying to use trio instead.

@riaqn
Copy link
Author

riaqn commented Dec 20, 2020

Also, do I get some guarantee that even in the case of a crash/exception, a release will be called for every remaining opened files? Because if I have the guarantee then I don't need the extra threads.

@riaqn riaqn changed the title Spawning threads? Spawning threads in handlers? Dec 20, 2020
@Nikratio
Copy link
Contributor

Thanks for your interest in pyfuse3! As far as I can tell, this is a question about how to use fuse rather than a bug report. Could you please send your question to the FUSE mailing list (https://lists.sourceforge.net/lists/listinfo/fuse-devel), instead of using the issue tracker? I'd like to reserve use of the latter to actually track issues and not use it for discussion.

Thanks!

(As for your question, yes, you are understanding correctly and yes, you should get a release() for every opened file. However, it is of course possible to crash the filesystem in such a way that it doesn't get around to handling all the release() requests that it receives).

@riaqn
Copy link
Author

riaqn commented Dec 23, 2020

Hello nikratio, thanks for reply.
I'm a bit confused actually. I have the impression that whether or not to pass nursery objects to the user handlers is a design choice made by pyfuse (and not fuse)?
But in any case, I give up using extra threading to track accesses, so I consider this issue no longer a problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants