Prevent "producer not unregistered" message (#5009)

pull/14/head
Amber Brown 6 years ago committed by Richard van der Hoff
parent 1a63c7c281
commit 6b2b9a58c4
  1. 1
      changelog.d/5009.bugfix
  2. 4
      synapse/rest/media/v1/_base.py

@ -0,0 +1 @@
Clients timing out/disappearing while downloading from the media repository will now no longer log a spurious "Producer was not unregistered" message.

@ -191,6 +191,10 @@ def respond_with_responder(request, responder, media_type, file_size, upload_nam
# in that case.
logger.warning("Failed to write to consumer: %s %s", type(e), e)
# Unregister the producer, if it has one, so Twisted doesn't complain
if request.producer:
request.unregisterProducer()
finish_request(request)

Loading…
Cancel
Save