Python fuse

I am currently writing a fuse using fuse-python. He is already doing what he should. However, after it is mounted for several weeks, it becomes noticeably slow. So I wanted to comment on this. I know about several points where it could be optimized. But they should not be the culprits.

However, fuse-python hangs in an infinite loop (see lines 733 and 757 of the fuse source ). If I started the fuse in debug mode (using the switch -d), it will work in the foreground. However, I cannot stop it with SIGINTand CTRL+C(which is the same anyway).

I tried to use a module signalto capture a signal in the main stream. But that doesn't work either. I wonder, as soon as I film the process with SIGKILL, I see KeyboardInterrupton stdout. In addition, after SIGKILLthe signal handler is executed as expected.

This has implications for profiling. Since the process never ends normally, it cProfilewill never be able to save the statistics file.

Any ideas?

+3
source share
1 answer

Python , KeyboardInterrupt SIGINT. , , , fuse_session_exit . , , KeyboardInterrupt CFUNCTYPE, .

:

  • SIGQUIT, Ctrl + \ , SIGINT. .
  • SIGINT , .

old_handler =signal(SIGINT, SIG_DFL)
# call main
signal(SIGINT, old_handler)

, fuse-python . fusepy .

FUSE , Python .

+8

Source: https://habr.com/ru/post/1793098/


All Articles