This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new ff8eed7786 Enable the NIO2 channel pool explicitly in the channel
recycle tests
ff8eed7786 is described below
commit ff8eed7786b5a7ef28c4cacbf13616042446581f
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Dec 2 22:38:35 2026 +0000
Enable the NIO2 channel pool explicitly in the channel recycle tests
The pool is disabled by default when the maximum heap is 2GB or less so the
tests failed with an NPE on systems with a small heap.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java | 2 ++
test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java | 2 ++
2 files changed, 4 insertions(+)
diff --git a/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
b/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
index d9f263f6a6..470d9de255 100644
--- a/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
+++ b/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
@@ -45,6 +45,8 @@ public class TestNio2ChannelRecycle extends TomcatBaseTest {
public void startConnector() throws Exception {
Tomcat tomcat = getTomcatInstance();
Assume.assumeTrue("NIO2 only",
tomcat.getConnector().getProtocolHandler() instanceof Http11Nio2Protocol);
+ // The pool is disabled by default if the heap is small so enable it
explicitly
+
Assert.assertTrue(tomcat.getConnector().setProperty("socket.bufferPool",
"100"));
tomcat.start();
Method getEndpoint =
AbstractProtocol.class.getDeclaredMethod("getEndpoint");
diff --git
a/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
b/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
index 1e9d2359ec..5fae44a46c 100644
--- a/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
+++ b/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
@@ -64,6 +64,8 @@ public class TestNio2SendfileChannelRecycle extends
TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "sendfile", new SendfileServlet(file));
ctx.addServletMappingDecoded("/sendfile", "sendfile");
+ // The pool is disabled by default if the heap is small so enable it
explicitly
+
Assert.assertTrue(tomcat.getConnector().setProperty("socket.bufferPool",
"100"));
tomcat.start();
Method getEndpoint =
AbstractProtocol.class.getDeclaredMethod("getEndpoint");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]