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

Intermittent EINVAL in ZFSPool.sync #193

Open
asomers opened this issue Jul 14, 2022 · 0 comments · May be fixed by #194
Open

Intermittent EINVAL in ZFSPool.sync #193

asomers opened this issue Jul 14, 2022 · 0 comments · May be fixed by #194

Comments

@asomers
Copy link
Contributor

asomers commented Jul 14, 2022

For me, ZFSPool.sync intermittently fails with EINVAL. Lately it's been happening almost every time, at least on some servers. The more frequent failures might've been triggered by upgrading from Python 3.8 to 3.9. Using pdb and gdb together shows that when it fails, the pool_name argument passed to lzc_sync is an empty string. However, pdb shows that in the lowest Python stack frame, the pool.name property looks fine. So somehow that property isn't being passed from Python to C correctly. Notably, pool.name is a property, not an instance variable. From experiment, I found that if I eliminate the property access from the sync method then everything works. But I don't know why. Is there a rule against accessing Python properties from Cython code?
I'll open a PR with my fix; I just don't know why it works.

asomers added a commit to asomers/py-libzfs that referenced this issue Jul 14, 2022
Sometimes ZFSPool.sync doesn't pass the pool_name argument to lzc_sync
correctly.  lzc_sync sees an empty string.  Replacing the self.name
property access with the self.handle instance variable access seems to
fix the problem, though I don't understand why.

Fixes truenas#193
@asomers asomers linked a pull request Jul 14, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant