summary refs log tree commit diff
path: root/synapse/rest/media/v1/_base.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-04-25 02:37:33 +1000
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-04-24 17:37:32 +0100
commit6b2b9a58c44c9c2f7efc45e8b588cde17fcdb0d4 (patch)
tree73b2573de3ee90b2ab6f88cfb4651887d6c9128b /synapse/rest/media/v1/_base.py
parentMerge pull request #5077 from matrix-org/babolivier/account_expiration (diff)
downloadsynapse-6b2b9a58c44c9c2f7efc45e8b588cde17fcdb0d4.tar.xz
Prevent "producer not unregistered" message (#5009)
Diffstat (limited to 'synapse/rest/media/v1/_base.py')
-rw-r--r--synapse/rest/media/v1/_base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/_base.py b/synapse/rest/media/v1/_base.py
index e2b5df701d..2dcc8f74d6 100644
--- a/synapse/rest/media/v1/_base.py
+++ b/synapse/rest/media/v1/_base.py
@@ -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)