Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add cancellation support to ReadWriteLock #12120

Merged
merged 16 commits into from
Mar 14, 2022

Commits on Mar 1, 2022

  1. Convert ReadWriteLock to use async context managers

    Has the side effect of fixing clean up for readers cancelled while
    waiting. Breaks the assumption that resolution of a writer `Deferred`
    means that previous readers and writers have completed, which will be
    fixed in the next commit.
    
    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    89fe787 View commit details
    Browse the repository at this point in the history
  2. Fix clean up when waiting readers or writers are cancelled

    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    f1f363d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9744823 View commit details
    Browse the repository at this point in the history
  4. Add ReadWriteLock cancellation tests

    Sean Quah committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    3241adc View commit details
    Browse the repository at this point in the history
  5. Add newsfile

    Sean Quah committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    68f5abe View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2022

  1. Configuration menu
    Copy the full SHA
    28dbe41 View commit details
    Browse the repository at this point in the history
  2. Use addBoth instead of addCallback, just in case

    Sean Quah committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    c9f85e4 View commit details
    Browse the repository at this point in the history
  3. Refactor tests to deduplicate _start_reader_or_writer. And improve th…

    …e docstrings.
    Sean Quah committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    716cded View commit details
    Browse the repository at this point in the history
  4. Add comments/docstrings and rename variables to make test_rwlock more…

    … understandable, hopefully
    Sean Quah committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    c4a2a58 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    31a2bb2 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

  1. Add delay_cancellation utility function

    `delay_cancellation` behaves like `stop_cancellation`, except it
    delays `CancelledError`s until the original `Deferred` resolves.
    This is handy for unifying cleanup paths and ensuring that uncancelled
    coroutines don't use finished logcontexts.
    
    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    1c1b46a View commit details
    Browse the repository at this point in the history
  2. Add missing space

    Sean Quah committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    65f97fa View commit details
    Browse the repository at this point in the history
  3. Simplify release of write lock by delaying cancellation until the loc…

    …k is acquired
    Sean Quah committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    cadfe0a View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2022

  1. Configuration menu
    Copy the full SHA
    1cd035b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4c47827 View commit details
    Browse the repository at this point in the history
  3. Update synapse/util/async_helpers.py

    Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
    squahtx and richvdh authored Mar 14, 2022
    Configuration menu
    Copy the full SHA
    1b9ec9b View commit details
    Browse the repository at this point in the history