X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=src%2Fpyutils%2Ffiles%2Flockfile.py;h=937c8631b9462bf168eb44b03bba79902918e4c7;hb=c5bdf67d6424f11e86f8f61e915dd6636688acf3;hp=68f957cbc080deed793cf2e24c14baddeecd6e48;hpb=6cc5bbeafe0451254bfc5cd3460061b1d3693c2d;p=pyutils.git diff --git a/src/pyutils/files/lockfile.py b/src/pyutils/files/lockfile.py index 68f957c..937c863 100644 --- a/src/pyutils/files/lockfile.py +++ b/src/pyutils/files/lockfile.py @@ -176,7 +176,8 @@ class LockFile(contextlib.AbstractContextManager): def __enter__(self): if self.acquire_with_retries(): return self - msg = f"Couldn't acquire {self.lockfile}; giving up." + contents = self._get_lockfile_contents() + msg = f"Couldn't acquire {self.lockfile} after several attempts. It's held by pid={contents.pid} ({contents.commandline}). Giving up." logger.warning(msg) raise LockFileException(msg)