summary refs log tree commit diff
path: root/synapse (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-03-09Handle cancellation in `DatabasePool.runInteraction()` github/squah/cancel_disconnected_requests squah/cancel_disconnected_requestsSean Quah1-24/+39
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 above 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>
2022-03-09Add tests for database callbacks after cancellationSean Quah1-0/+59
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-09Add tests for database callbacksSean Quah1-1/+112
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-09Remove dead codeSean Quah1-16/+0
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-08Add tests for logcontexts during `@cached` and `@cachedList` cancellationSean Quah1-0/+90
2022-03-08Add basic cancellation tests for `@cached` and `@cachedList` decoratorsSean Quah1-2/+55
2022-03-08Fix logcontexts when `@cached` and `@cachedList` lookups are cancelledSean Quah1-0/+11
`@cached` and `@cachedList` must wait until the wrapped method has completed before raising `CancelledError`s, otherwise the wrapped method will continue running in the background with a logging context that has been marked as finished.
2022-03-08Add `delay_cancellation` utility functionSean Quah1-0/+56
`delay_cancellation` behaves like `stop_cancellation`, except it de