From 2b75e98c92177cdc99720887bcc8e0161e15c3a7 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/borg/fuse.py b/src/borg/fuse.py index fe23c4e37..15c1e13d4 100644 --- a/src/borg/fuse.py +++ b/src/borg/fuse.py @@ -1,3 +1,19 @@ +""" +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