From aa3e7defcdf2186acb0a77e46dc4902ea066c199 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 30 Aug 2021 15:50:04 +0200 Subject: [PATCH] Issue #6603 - HTTP/2 max local stream count exceeded Made newEntry() private to avoid creation of more than 2 Entry subclasses. Signed-off-by: Simone Bordet --- jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java index 629cc66d174b..921d6af5a417 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java @@ -353,8 +353,10 @@ public Entry reserve() } } - protected Entry newEntry() + private Entry newEntry() { + // Do not allow more than 2 implementations of Entry, otherwise call sites in Pool + // referencing Entry methods will become mega-morphic and kill the performance. if (maxMultiplex >= 0 || maxUsage >= 0) return new MultiEntry(); return new MonoEntry();