Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locks: allow locks to work under high contention #27846

Merged
merged 2 commits into from
Dec 22, 2021
Merged

locks: allow locks to work under high contention #27846

merged 2 commits into from
Dec 22, 2021

Commits on Dec 7, 2021

  1. locks: allow locks to work under high contention

    This is a bug found by Harshitha Menon.  This solution is a bit
    different from what we discussed.  The `lock=None` line shouldn't be a
    release, based on my testing, but should be `return (lock_type, None)`
    to inform the caller it couldn't get the lock type requested without
    disturbing the existing lock object in the database.  There were also a
    couple of bugs due to taking write locks at the beginning without any
    checking or release, and not releasing read locks before requeueing.
    This version no longer gives me read upgrade to write errors, even
    running 200 instances on one box.
    
    * Change lock in check_deps_status to read, release if not installed,
      not sure why this was ever write, but read definitely is more
      appropriate here, and the read lock is only held out of the scope if
      the package is installed.
    * Release read lock before requeueing to reduce chance of livelock, the
      timeout that caused the original issue now happens in roughly 3 of 200
      workers instead of 199 on average.
    trws committed Dec 7, 2021
    Configuration menu
    Copy the full SHA
    719ae9a View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2021

  1. fix lock type in comment

    trws committed Dec 14, 2021
    Configuration menu
    Copy the full SHA
    3e0897d View commit details
    Browse the repository at this point in the history