tornado: Replace a TODO comment with an explanation.

This commit is contained in:
Alex Vandiver 2023-12-11 21:41:26 +00:00 committed by Tim Abbott
parent 886a86866d
commit b032b2a4da
1 changed files with 4 additions and 3 deletions

View File

@ -210,9 +210,10 @@ class AsyncDjangoHandler(tornado.web.RequestHandler):
# Register a Tornado handler that runs when client-side
# connections are closed to notify the events system.
#
# TODO: Theoretically, this code should run when you Ctrl-C
# curl to cause it to break a `GET /events` connection, but
# that seems to no longer run this code. Investigate what's up.
# Note that in the development environment, the development
# proxy does not correctly close connections to Tornado when
# its clients (e.g. `curl`) close their connections. This
# code path is thus _unreachable except in production_.
client_descriptor = get_descriptor_by_handler_id(self.handler_id)
if client_descriptor is not None:
client_descriptor.disconnect_handler(client_closed=True)