From 4eed3ecd5b378c8cd899fd3fe89df001f7d43a65 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 3 Jan 2026 19:45:39 +0100 Subject: [PATCH] fuse: add thread/async safety warning --- src/borg/fuse.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/borg/fuse.py b/src/borg/fuse.py index 3a9db701c..921a7d6a0 100644 --- a/src/borg/fuse.py +++ b/src/borg/fuse.py @@ -1,3 +1,18 @@ +""" +FUSE filesystem implementation for `borg mount`. + +IMPORTANT +========= + +This code is only safe for single-threaded and synchronous (non-async) usage. + +- llfuse is synchronous and used with workers=1, so there is only 1 thread, + and we are safe. +- pyfuse3 uses Trio, which only uses 1 thread, but could use this code in an + asynchronous manner. However, as long as we do not use any asynchronous + operations (like using "await") in this code, it is still de facto + synchronous, and we are safe. +""" import errno import functools import io