Skip to content

Commit c65b7b6

Browse files
committed
jetty: drop per-client and global rate limiter
Motivation: as the behaviour of the rate limiter doesn't match admins expectations and introduces lot of complains, let disable per-client and global rate limiter. Modification: comment out per-client and global rate limiter. Result: enforce rate limitesr only for authentication errors. Fixes: #8102 Acked-by: Anastasiia Chub Target: master, 12.0, 11.2 Require-book: no Require-notes: yes (cherry picked from commit d764662) Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
1 parent 935bbeb commit c65b7b6

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎modules/dcache/src/main/java/org/dcache/util/jetty/RateLimitedHandlerList.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
240240
return;
241241
}
242242

243+
244+
245+
// REVISIT: do we want to keep per-client rate limiter or only for authentication errors?
246+
/*
243247
if (!getClientRateLimiter(client).tryAcquire()) {
244248
LOGGER.debug("Blocking client with too many requests {}", client);
245249
response.setStatus(HttpStatus.TOO_MANY_REQUESTS_429);
@@ -257,7 +261,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
257261
baseRequest.setHandled(true);
258262
return;
259263
}
260-
264+
*/
261265
Handler[] handlers = this.getHandlers();
262266
if (handlers != null && this.isStarted()) {
263267
for (Handler handler : handlers) {

‎modules/dcache/src/test/java/org/dcache/util/jetty/RateLimitedHandlerListTest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.eclipse.jetty.server.Request;
66
import org.eclipse.jetty.server.handler.AbstractHandler;
77
import org.junit.Before;
8+
import org.junit.Ignore;
89
import org.junit.Test;
910
import org.mockito.Mockito;
1011

@@ -82,6 +83,7 @@ public void testGlobalRateOk() throws ServletException, IOException, Interrupted
8283

8384

8485
@Test
86+
@Ignore
8587
public void testGlobalRateExceeded() throws ServletException, IOException, InterruptedException {
8688

8789
handlerList.setMaxGlobalRequestsPerSecond(10);

0 commit comments

Comments
 (0)