profiling fuse-python -
i writing fuse using fuse-python. it's doing should. however, after it's mounted few weeks, it's becoming noticeably slow. wanted profile it. know few point optimized. these should not culprits.
however, fuse-python hangs in infinite loop (see line 733 , 757 of fuse source). if run fuse in debug mode (using -d
switch), run in foreground. however, cannot stop sigint
nor ctrl+c
(which anyway same).
i tried use signal
module trap signal in main thread. not work either. interestingly, once shoot process down sigkill
, see keyboardinterrupt
on stdout
. also, after sigkill
, signal handler executed expected.
this has repercussions on profiling. process never terminates normally, cprofile
never gets chance save stats file.
any ideas?
python installs handler raises keyboardinterrupt
on sigint
. if non-default signal handler detected when fuse's main called, not replace handler own, calls fuse_session_exit
, cleans up. after you've called fuse's main, keyboardinterrupt
swallowed cfunctype
wrappers , never see them.
your options to:
- send
sigquit
pressing ctrl+\, or other terminating signal othersigint
. fuse not exit cleanly. - install default signal handler
sigint
before calling fuse's main, , restore original when you're done.
old_handler =signal(sigint, sig_dfl) # call main signal(sigint, old_handler)
i'd highly recommend switch alternative binding also, fuse-python terribly messy , difficult work with. i've had lot of luck fusepy, , have submitted few patches there.
when you're able terminate fuse instance without using uncaught signals, python profiler able save stats per normal.
Comments
Post a Comment