Fix race condition by making the scrub function idempotent
Under certain situtations, a race condition could lead to pvc deletion tasks getting stuck in a failing state.
This commit is contained in:
parent
8db829ed6e
commit
89de295293
@ -6,6 +6,10 @@ def scrub(volume_id):
|
|||||||
import time
|
import time
|
||||||
import rawfile_util
|
import rawfile_util
|
||||||
|
|
||||||
|
img_dir = rawfile_util.img_dir(volume_id)
|
||||||
|
if not img_dir.exists():
|
||||||
|
return
|
||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
deleted_at = now
|
deleted_at = now
|
||||||
gc_at = now # TODO: GC sensitive PVCs later
|
gc_at = now # TODO: GC sensitive PVCs later
|
||||||
|
Loading…
Reference in New Issue
Block a user