Skip to content

Commit df2cfb3

Browse files
Link upstream Twisted bug: Idle connection timeout incorrectly enforced while sending large response with Request.write(...) (#18855)
Link upstream Twisted bug -> twisted/twisted#12498 Spawning from #18852
1 parent c339021 commit df2cfb3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/18855.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Link [upstream Twisted bug](https://github.com/twisted/twisted/issues/12498) tracking the problem that explains why we have to use a `Producer` to write bytes to the request.

synapse/http/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,9 @@ def _write_bytes_to_request(request: Request, bytes_to_write: bytes) -> None:
913913
# once (via `Request.write`) is that doing so starts the timeout for the
914914
# next request to be received: so if it takes longer than 60s to stream back
915915
# the response to the client, the client never gets it.
916+
# c.f https://github.com/twisted/twisted/issues/12498
916917
#
917-
# The correct solution is to use a Producer; then the timeout is only
918+
# One workaround is to use a `Producer`; then the timeout is only
918919
# started once all of the content is sent over the TCP connection.
919920

920921
# To make sure we don't write all of the bytes at once we split it up into

0 commit comments

Comments
 (0)