mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 03:19:26 -05:00
Catch AttributeErrors when calling registerProducer (#10995)
Looks like the wrong exception type was caught in #10932.
This commit is contained in:
parent
f563676c09
commit
52aefd5086
1
changelog.d/10995.bugfix
Normal file
1
changelog.d/10995.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Correct a bugfix introduced in Synapse v1.44.0 that wouldn't catch every error of the connection breaks before a response could be written to it.
|
@ -563,7 +563,10 @@ class _ByteProducer:
|
||||
|
||||
try:
|
||||
self._request.registerProducer(self, True)
|
||||
except RuntimeError as e:
|
||||
except AttributeError as e:
|
||||
# Calling self._request.registerProducer might raise an AttributeError since
|
||||
# the underlying Twisted code calls self._request.channel.registerProducer,
|
||||
# however self._request.channel will be None if the connection was lost.
|
||||
logger.info("Connection disconnected before response was written: %r", e)
|
||||
|
||||
# We drop our references to data we'll not use.
|
||||
|
Loading…
Reference in New Issue
Block a user