summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-05-09 21:51:48 +0000
committerGerrit Code Review <review@openstack.org>2023-05-09 21:51:48 +0000
commitb669e3298160636a8ad17d37d844c8eff8fba910 (patch)
tree8886b65a6e91a1d3e52a56a62ecbfe7f63f666e1
parent89e2050d7f99b8eb392cc35a3d23e4e8eb54fb7a (diff)
parent9d98721e7c94677ed06224b8f8c8c69e26793fec (diff)
downloadswift-b669e3298160636a8ad17d37d844c8eff8fba910.tar.gz
Merge "backend_ratelimit: Tighten blanket exception handling"
-rw-r--r--swift/common/middleware/backend_ratelimit.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/swift/common/middleware/backend_ratelimit.py b/swift/common/middleware/backend_ratelimit.py
index 980e9edc4..75e6e9741 100644
--- a/swift/common/middleware/backend_ratelimit.py
+++ b/swift/common/middleware/backend_ratelimit.py
@@ -66,13 +66,14 @@ class BackendRateLimitMiddleware(object):
try:
device, partition, _ = split_and_validate_path(req, 1, 3, True)
int(partition) # check it's a valid partition
+ except Exception: # noqa
+ # request may not have device/partition e.g. a healthcheck req
+ pass
+ else:
rate_limiter = self.rate_limiters[device]
if not rate_limiter.is_allowed():
self.logger.increment('backend.ratelimit')
handler = HTTPTooManyBackendRequests()
- except Exception: # noqa
- # request may not have device/partition e.g. a healthcheck req
- pass
return handler(env, start_response)