From 8f59afb1593a75b8ce8c91ceee304097a07aea6e Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 14 Jul 2023 15:21:14 +0000 Subject: [PATCH] fix another race (unpost): unposting could collide with most other database-related activities, causing one or the other to fail. luckily the unprotected query performed by the unpost API happens to be very cheap, so also the most likely to fail, and would succeed upon a manual reattempt from the UI. even in the worst case scenario, there would be no unrecoverable damage as the next rescan would auto-repair any resulting inconsistencies. --- copyparty/up2k.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index f4b3e53f..044bdcb7 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3000,7 +3000,8 @@ class Up2k(object): permsets = [[False, True]] vn, rem = self.asrv.vfs.get(vpath, uname, *permsets[0]) vn, rem = vn.get_dbv(rem) - _, _, _, _, dip, dat = self._find_from_vpath(vn.realpath, rem) + with self.mutex: + _, _, _, _, dip, dat = self._find_from_vpath(vn.realpath, rem) t = "you cannot delete this: " if not dip: