Skip to content

Commit

Permalink
fix another race (unpost):
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
9001 committed Jul 14, 2023
1 parent 77f1e51 commit 8f59afb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion copyparty/up2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,8 @@ def _handle_rm(
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:
Expand Down

0 comments on commit 8f59afb

Please sign in to comment.