From 0d97dbf5348046ddbd8680fb2ddcd9b8d325f89b Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 30 Dec 2022 05:50:09 -0500 Subject: [PATCH] Tunnels: Add another tier for client tunnel build limiter only if configured for 6 or more tunnels --- router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java index d98b87f3c..34372fda4 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java @@ -338,10 +338,14 @@ public class TunnelPool { // throttle client tunnel builds in times of congestion int fails = _consecutiveBuildTimeouts.get(); if (fails > 4) { - if (fails > 8) { + if (fails > 12) { rv = 1; if (_log.shouldWarn()) _log.warn("Limit to 1 tunnel after " + fails + " consec. build timeouts on " + this); + } else if (fails > 8) { + rv = Math.max(1, rv / 3); + if (_log.shouldWarn()) + _log.warn("Limit to " + rv + " tunnels after " + fails + " consec. build timeouts on " + this); } else if (rv > 2) { rv--; if (_log.shouldWarn())