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

Handle cancellation in DatabasePool.runInteraction() #12199

Merged
merged 6 commits into from
Mar 16, 2022

Commits on Mar 9, 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 9, 2022
    Configuration menu
    Copy the full SHA
    c734388 View commit details
    Browse the repository at this point in the history
  2. Add tests for database transaction callbacks

    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    ea9fb47 View commit details
    Browse the repository at this point in the history
  3. Handle cancellation in DatabasePool.runInteraction()

    To handle cancellation, we ensure that `after_callback`s and
    `exception_callback`s are always run, since the transaction will
    complete on another thread regardless of cancellation.
    
    We also wait until everything is done before releasing the
    `CancelledError`, so that logging contexts won't get used after they
    have been finished.
    
    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    5397ae4 View commit details
    Browse the repository at this point in the history
  4. Add tests for database callbacks after cancellation

    Signed-off-by: Sean Quah <seanq@element.io>
    Sean Quah committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    f202922 View commit details
    Browse the repository at this point in the history
  5. Add newsfile

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

Commits on Mar 15, 2022

  1. Configuration menu
    Copy the full SHA
    d23512f View commit details
    Browse the repository at this point in the history