-
Notifications
You must be signed in to change notification settings - Fork 24
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
Reevaluate the need of libzfs.ZFS context manager lock #250
Comments
The lock is still needed. Libzfs is known not to be threadsafe. |
Can you please provide me some details? I would like to help eliminate that, or if not possible, understand the reasons. Thanks |
@rkojedzinszky there are places in libzfs that make non-reentrant syscalls (getpw* and getgrp* come to mind) and there is also global memory that isn't protected by any mechanism. |
@yocalebo Diggint into openzfs:
Unfortunately, yes, there are calls to those functions, howewer, only here. Can you please point me to some global memory in libzfs? |
I think probably the better place to start if you want to make libzfs threadsafe is via upstream openzfs community (mailing lists or slack). Once the changes are in the ZFS version in TrueNAS we will happily remove locks (once we're sure there aren't other issues). |
@anodos325 working on it: openzfs/zfs#15793 |
@anodos325 openzfs/zfs#15793 has been closed, not by merge but by commits applied to master branch. Can we go further with this? |
bc687e9 added a global lock on zfs objects when used as context manager. Howewer, just when used as context manager. So, this may not protect in every case if the underlying libzfs is not thread safe.
Is this lock still needed? I mean, if I have an application with multiple threads, each thread managing its libzfs.ZFS object, will I still need a global lock to serialize them? Or perhaps, libzfs itself is threadsafe now. I suspect libzfs wants to be threadsafe, so if there is a known issue, then we should report this upstream.
The text was updated successfully, but these errors were encountered: