Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tornado: Fix race condition on handler._request.

Anders Kaseorge112b619ccd9
diff --git a/zerver/tornado/views.py b/zerver/tornado/views.py
index a886f85e3a1..1ad831ef0f5 100644
--- a/zerver/tornado/views.py
+++ b/zerver/tornado/views.py
@@ -125,6 +125,7 @@ def get_events_backend(
assert tornado_handler is not None
handler = tornado_handler()
assert handler is not None
+ handler._request = request
if user_client is None:
valid_user_client = RequestNotes.get_notes(request).client
@@ -173,7 +174,6 @@ def get_events_backend(
# Return an AsynchronousResponse; this will result in
# Tornado discarding the response and instead long-polling the
# request. See zulip_finish for more design details.
- handler._request = request
return AsynchronousResponse()
if result["type"] == "error":
raise result["exception"]