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

Capture the Deferred for request cancellation in _AsyncResource #12694

Merged
merged 4 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12694.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Capture the `Deferred` for request cancellation in `_AsyncResource`.
4 changes: 3 additions & 1 deletion synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def __init__(self, extract_context: bool = False):

def render(self, request: SynapseRequest) -> int:
"""This gets called by twisted every time someone sends us a request."""
defer.ensureDeferred(self._async_render_wrapper(request))
request.render_deferred = defer.ensureDeferred(
self._async_render_wrapper(request)
)
return NOT_DONE_YET

@wrap_async_request_handler
Expand Down