Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before, when logdir is not writable, _try_lock will raise an Exception like "Permission denied: '/var/log/log_lock.pid'", and in this case, _unlock_thread will not be called and the variable count will not be handled, it maybe cause log_lock.pid not be deleted in case like [1]. For [1], it is an cross compile case, when dnf install some packages to rootfs, seems like some threads don't do chroot like work, some threads do chroot like work. so for the threads don't do chroot, "Permission denied" Exception happend, for the threads that do chroot, log_lock.pid will be created under installroot/var/log/log_lock.pid, since variable count not handled correct before, log_lock.pid may not be deleted correctly. So fixed like this, if _try_lock raise Exception, _unlock_thread first, then raise the Exception. [1] #1963 Signed-off-by: Changqing Li <[email protected]>
- Loading branch information