Merge commit '4876af06d' into anoa/dinsic_release_1_18_x
* commit '4876af06d': Abort federation requests if the client disconnects early (#7930)
This commit is contained in:
1
changelog.d/7930.feature
Normal file
1
changelog.d/7930.feature
Normal file
@@ -0,0 +1 @@
|
||||
Abort federation requests where the client disconnects before the ratelimiter expires.
|
||||
@@ -339,6 +339,12 @@ class BaseFederationServlet(object):
|
||||
if origin:
|
||||
with ratelimiter.ratelimit(origin) as d:
|
||||
await d
|
||||
if request._disconnected:
|
||||
logger.warning(
|
||||
"client disconnected before we started processing "
|
||||
"request"
|
||||
)
|
||||
return -1, None
|
||||
response = await func(
|
||||
origin, content, request.args, *args, **kwargs
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user