diff --git a/xarray/backends/locks.py b/xarray/backends/locks.py index 784443544ee..16331b9d1b1 100644 --- a/xarray/backends/locks.py +++ b/xarray/backends/locks.py @@ -218,6 +218,9 @@ def __init__(self, locks: Sequence[Lock]): self.locks = tuple(set(locks)) # remove duplicates def acquire(self, blocking=True): + assert blocking, ( + "Without blocking you will never know which locks you have to unlock!" + ) return all(acquire(lock, blocking=blocking) for lock in self.locks) def release(self):