pmlogger_check fix small timing window / race condition
There was a race condition that was sometimes exposed by QA test 119
where the attempt to create the lock file would fail because the lock
file already existed, but by the time the status of the lock file was
checked the lock file had been removed. Some convoluted logic
translated this into the confusing messages
Warning: removing lock file older than 30 minutes
ls: cannot access /lock: No such file or directory
Fixed by a guard to test the existence of the lock file after the
pmlock fails.
All of this is safe because it is within a loop that keeps trying to
acquire the lock, and the race condition is most unlikely to be
persistent.
pmlogger_check fix small timing window / race condition
There was a race condition that was sometimes exposed by QA test 119
where the attempt to create the lock file would fail because the lock
file already existed, but by the time the status of the lock file was
checked the lock file had been removed. Some convoluted logic
translated this into the confusing messages
Warning: removing lock file older than 30 minutes
ls: cannot access /lock: No such file or directory
Fixed by a guard to test the existence of the lock file after the
pmlock fails.
All of this is safe because it is within a loop that keeps trying to
acquire the lock, and the race condition is most unlikely to be
persistent.