Skip to content
Snippets Groups Projects
Unverified Commit 56116445 authored by Andrew Morgan's avatar Andrew Morgan Committed by GitHub
Browse files

Workaround for failure to wrap reason in Failure (#7473)

parent eafd103f
No related branches found
No related tags found
No related merge requests found
Workaround for an upstream Twisted bug that caused Synapse to become unresponsive after startup.
\ No newline at end of file
......@@ -15,6 +15,7 @@ import contextlib
import logging
import time
from twisted.python.failure import Failure
from twisted.web.server import Request, Site
from synapse.http import redact_uri
......@@ -190,6 +191,12 @@ class SynapseRequest(Request):
Overrides twisted.web.server.Request.connectionLost to record the finish time and
do logging.
"""
# There is a bug in Twisted where reason is not wrapped in a Failure object
# Detect this and wrap it manually as a workaround
# More information: https://github.com/matrix-org/synapse/issues/7441
if not isinstance(reason, Failure):
reason = Failure(reason)
self.finish_time = time.time()
Request.connectionLost(self, reason)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment