• 
      

    Fix locking in the extension manager.

    Review Request #15036 — Created May 9, 2026 and submitted

    Information

    Djblets
    release-6.x

    Reviewers

    I've noticed that sometimes when our CI server is under high load, we
    were getting an intermittent test failure in
    ExtensionManagerTests.test_install_media_concurrent_threads.

    This lead me to discover that in Django 3.2,
    django.core.files.locks.lock() changed its interface to return False
    instead of raise IOError. This meant that our use of this has not
    actually been using the lock at all. This change updates the extension
    manager to check the return value and raise an IOError to restore the
    behavior described in the docstring.

    • Ran unit tests.
    • Artificially created a high load situation and verified that prior to
      the fix we would hit contention, and after we properly respect the lock.
    • Grepped through our codebases to ensure there weren't any other
      similar bugs.
    Summary ID
    Fix locking in the extension manager.
    I've noticed that sometimes when our CI server is under high load, we were getting an intermittent test failure in ExtensionManagerTests.test_install_media_concurrent_threads. This lead me to discover that in Django 3.2, `django.core.files.locks.lock()` changed its interface to return `False` instead of raise `IOError`. This meant that our use of this has not actually been using the lock at all. This change updates the extension manager to check the return value and raise an IOError to restore the behavior described in the docstring. Testing Done: - Ran unit tests. - Artificially created a high load situation and verified that prior to the fix we would hit contention, and after we properly respect the lock. - Grepped through our codebases to ensure there weren't any other similar bugs.
    wwslqmksnmrltxxzrozwpokmmnmzszlu
    chipx86
    1. Ship It!
    2. 
        
    maubin
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-5.x (0094bbb)