From 139c483e0cda48685f29df6aaf42b315e482b5cb Mon Sep 17 00:00:00 2001 From: jonmv Date: Mon, 15 May 2023 14:44:35 +0200 Subject: Use conn hashcode for distribution instead --- .../java/com/yahoo/jdisc/http/server/jetty/HttpRequestDispatch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/HttpRequestDispatch.java b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/HttpRequestDispatch.java index fa83593ea2b..b92a723fac8 100644 --- a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/HttpRequestDispatch.java +++ b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/HttpRequestDispatch.java @@ -163,7 +163,7 @@ class HttpRequestDispatch { double maxConnectionLifeInSeconds = connectorConfig.maxConnectionLife(); if (maxConnectionLifeInSeconds > 0) { long createdAt = connection.getCreatedTimeStamp(); - long tenPctVariance = createdAt % 10; // should be random enough, and must be consistent for a given connection + long tenPctVariance = connection.hashCode() % 10; // should be random enough, and must be consistent for a given connection Instant expiredAt = Instant.ofEpochMilli((long) (createdAt + maxConnectionLifeInSeconds * 10 * (100 - tenPctVariance))); boolean isExpired = Instant.now().isAfter(expiredAt); if (isExpired) { -- cgit v1.2.3