Timeout membership requests after 90s

This is a hacky fix to try and stop in flight requests from building up
This commit is contained in:
Erik Johnston 2018-07-02 13:56:08 +01:00
parent 6a95270671
commit ca21957b8a

View file

@ -246,8 +246,22 @@ class RoomMemberHandler(object):
if requester.app_service:
as_id = requester.app_service.id
then = self.clock.time_msec()
with (yield self.member_limiter.queue(as_id)):
diff = self.clock.time_msec() - then
if diff > 90 * 1000:
# haproxy would have timed the request out anyway...
raise SynapseError(504, "took to long to process")
with (yield self.member_linearizer.queue(key)):
diff = self.clock.time_msec() - then
if diff > 90 * 1000:
# haproxy would have timed the request out anyway...
raise SynapseError(504, "took to long to process")
result = yield self._update_membership(
requester,
target,