You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cdef void functions in handlers.pxi that are assigned to fuse_lowlevel_ops should never raise exceptions. Where do you see them use raise?
Nevermind, found it. I believe the affected methods are fuse_write and fuse_setxattr (which raise OverflowError if the data size doesn't fit into ssize_t (pretty unlikely) and fuse_init (which raises a RuntimeError if the kernel is too old).
Neither of these checks can easily be moved elsewhere. For the first two, I would suggest to instead return EINVAL through fuse_reply_err() and log the error (using Python's logging module). For the third, the best I can think of is to set some sort of global flag, check it in init() (after the call to fuse_session_new) and raise the exception there if set.
The text was updated successfully, but these errors were encountered:
This tells Cython that callbacks may raise exceptions, and that exception status should be checked on return from fuse_session_process_buf. It eliminates the warnings and seems to work:
python-venv examples/hello.py ~/tmp/mnt
Traceback (most recent call last):
File "/home/nikratio/in-progress/pyfuse3/examples/hello.py", line 157, in <module>
main()
File "/home/nikratio/in-progress/pyfuse3/examples/hello.py", line 148, in main
trio.run(pyfuse3.main)
File "/usr/lib/python3/dist-packages/trio/_core/_run.py", line 2010, in run
raise runner.main_task_outcome.error
File "/home/nikratio/in-progress/pyfuse3/src/_pyfuse3.py", line 43, in wrapper
await fn(*args, **kwargs)
File "src/pyfuse3.pyx", line 781, in main
async with trio.open_nursery() as nursery:
File "/usr/lib/python3/dist-packages/trio/_core/_run.py", line 850, in __aexit__
raise combined_error_from_nursery
File "/home/nikratio/in-progress/pyfuse3/src/_pyfuse3.py", line 43, in wrapper
await fn(*args, **kwargs)
File "src/internal.pxi", line 270, in _session_loop
fuse_session_process_buf(session, &buf)
File "src/handlers.pxi", line 53, in pyfuse3.fuse_init
raise RuntimeError('testing error handling')
RuntimeError: testing error handling
Copied from a comment of @Nikratio in #81 :
Nevermind, found it. I believe the affected methods are
fuse_write
andfuse_setxattr
(which raiseOverflowError
if the data size doesn't fit intossize_t
(pretty unlikely) andfuse_init
(which raises aRuntimeError
if the kernel is too old).Neither of these checks can easily be moved elsewhere. For the first two, I would suggest to instead return EINVAL through
fuse_reply_err()
and log the error (using Python's logging module). For the third, the best I can think of is to set some sort of global flag, check it ininit()
(after the call to fuse_session_new) and raise the exception there if set.The text was updated successfully, but these errors were encountered: