Convert ivy lock to use OwnerPrintingPIDLockFile

Review Request #3598 - Created March 23, 2016 and submitted

Eric Ayers
3075, 3079
gmalmquist, kwlzn, patricklaw

We've seen some instances of stale locks in CI builders and from developer reports. Use our wrapper around the lockfile library to recover stale locks.

Update lockfile to the latest version (0.12.2)

CI running at

The repro case is described in

We already use this kind of lock in the global lock and in the pants daemon.

I tested this manually by:

  • Touching a lockfile to ~/.ivy2/pants/pants_lock_file.lock and then re-running ./pants clean-all compile src/java:: which ran sucessfully.
  • Adding a breakpoint inside of with self._lock:, starting ./pants clean-all compile src/java:: and using kill -9 to kill all pants tasks, then re-running ./pants clean-all compile src/java::
    Verified that the new debug statement for breaking the lock printed and compile worked successfully
  • Ran ./pants clean-all compile src/java:: in one window, then in another window removed the global lock and re-ran ./pants clean-all compile src/java::
    Raised exception:
    Exception caught: (<class 'lockfile.AlreadyLocked'>) 
    Exception message: /Users/zundel/.ivy2/pants/pants_ivy_lock is already locked


  • 0
  • 0
  • 1
  • 1
Description From Last Updated
Patrick Lawson
Kris Wilson
Eric Ayers
Patrick Lawson
Garrett Malmquist
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks Patrick, Kris, and Garrett! In master at f377d98. There's still some followup work, see: