I am currently writing a fuse using fuse-python. It's already doing what it should. However, after it's mounted for a few weeks, it's becoming noticeably slow. So I wanted to profile it. I know about a few point where it could be optimized. But these should not be the culprits.
However, fuse-python hangs in an infinite loop (see line 733 and 757 of the fuse source). If I run fuse in debug mode (using the -d
switch), it will run in foreground. However, I cannot stop it with SIGINT
nor with CTRL+C
(which is anyway the same).
I tried to use the signal
module to trap the signal in the main thread. But this does not work either. Interestingly, once I shoot the process down with SIGKILL
, I see the KeyboardInterrupt
on stdout
. Also, after a SIGKILL
, the signal handler is executed as expected.
This has repercussions on profiling. As the process never terminates normally, cProfile
never gets the chance to save the stats file.
Any ideas?