Skip to content

Instantly share code, notes, and snippets.

@vxgmichel
Created March 12, 2019 18:01
Show Gist options
  • Save vxgmichel/fdaa49066937d56687ad174185fc4411 to your computer and use it in GitHub Desktop.
Save vxgmichel/fdaa49066937d56687ad174185fc4411 to your computer and use it in GitHub Desktop.
Demonstrate signal issues in a fusepy application with multiple instances
import os
import time
import pathlib
from concurrent.futures import ThreadPoolExecutor
from fuse import FUSE, Operations
with ThreadPoolExecutor() as executor:
mountpoint1 = "./a"
pathlib.Path(mountpoint1).mkdir(exist_ok=True)
executor.submit(FUSE, Operations(), mountpoint1, foreground=True)
mountpoint2 = "./b"
pathlib.Path(mountpoint2).mkdir(exist_ok=True)
executor.submit(FUSE, Operations(), mountpoint2, foreground=True)
try:
# Won't stop on a SIGTERM
time.sleep(3)
finally:
# Print the following message to stderr
# fuse: fuse_remove_signal_handlers: unknown session
os.system("fusermount -u " + mountpoint1)
os.system("fusermount -u " + mountpoint2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment