[Buildbot-commits] [buildbot/buildbot] a16c4e: Maintain locks in FIFO order

GitHub noreply at github.com
Tue Jul 31 01:46:56 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/buildbot/buildbot
  Commit: a16c4ececcab7f304d369f742e6e3dff04b66a95
      https://github.com/buildbot/buildbot/commit/a16c4ececcab7f304d369f742e6e3dff04b66a95
  Author: Jacob Stultz <jstultz at alum.mit.edu>
  Date:   2012-07-30 (Mon, 30 Jul 2012)

  Changed paths:
    M master/buildbot/buildslave.py
    M master/buildbot/locks.py
    M master/buildbot/process/build.py
    M master/buildbot/process/buildstep.py

  Log Message:
  -----------
  Maintain locks in FIFO order

Locks should be kept in a queue in FIFO order to prevent potential
exclusive lock holders from being starved by a continuous stream of
counting locks holders.

This change maintains order of all waiters in a FIFO queue until they
actually acquire the lock, instead of removing them from the queue on
wake and adding them back to the end if they failed to acquire the lock.

The Deferred instance associated with each waiter is cleared when it is
woken. It is set when waitUntilMaybeAvailable is called.


  Commit: d76c5d32340c123c72bf20069e879a7f10327a3c
      https://github.com/buildbot/buildbot/commit/d76c5d32340c123c72bf20069e879a7f10327a3c
  Author: Jacob Stultz <jstultz at alum.mit.edu>
  Date:   2012-07-30 (Mon, 30 Jul 2012)

  Changed paths:
    M master/buildbot/test/unit/test_process_build.py

  Log Message:
  -----------
  Ensure that locks are acquired in FIFO order

To prevent starvation, locks should be acquired in the order in which
they were requested. Particularly, counting locks requested after
exclusive locks must wait until after the exclusive lock is acquired
and subsequently released, even if the owner(s) at the time the lock
is requested are counting and below maxCount.

The test acquires a counting lock, and then starts a build needing an
exclusive lock followed by a build needing a counting lock. The first
counting lock is then released, and the test checks that the exclusive
lock was claimed before the second counting lock.


  Commit: 2c0f2ff07503c167ec217b97b8196069ed4c876d
      https://github.com/buildbot/buildbot/commit/2c0f2ff07503c167ec217b97b8196069ed4c876d
  Author: Dustin J. Mitchell <dustin at mozilla.com>
  Date:   2012-07-30 (Mon, 30 Jul 2012)

  Changed paths:
    M master/buildbot/buildslave.py
    M master/buildbot/locks.py
    M master/buildbot/process/build.py
    M master/buildbot/process/buildstep.py
    M master/buildbot/test/unit/test_process_build.py

  Log Message:
  -----------
  Merge branch 'nostarve' of git://github.com/jstultz/buildbot


Compare: https://github.com/buildbot/buildbot/compare/1ee7a1dc01d7...2c0f2ff07503


More information about the Commits mailing list