We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8572cc4 commit 4b346bdCopy full SHA for 4b346bd
tornado/httpserver.py
@@ -190,7 +190,14 @@ def _on_write_complete(self):
190
callback = self._write_callback
191
self._write_callback = None
192
callback()
193
- if self._request_finished:
+ # _on_write_complete is enqueued on the IOLoop whenever the
194
+ # IOStream's write buffer becomes empty, but it's possible for
195
+ # another callback that runs on the IOLoop before it to
196
+ # simultaneously write more data and finish the request. If
197
+ # there is still data in the IOStream, a future
198
+ # _on_write_complete will be responsible for calling
199
+ # _finish_request.
200
+ if self._request_finished and not self.stream.writing():
201
self._finish_request()
202
203
def _finish_request(self):
0 commit comments