Skip to content

Commit 337c7b8

Browse files
authored
servlet: disable RECYCLE_FACADES to reduce flaky tests
Set discardFacades=false in Tomcat 10 Embedded to avoid premature OutputBuffer recycling. This works around flaky tests in gRPC servlet transport by ensuring facades are not discarded too early. Fixes #12524
1 parent f385add commit 337c7b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

servlet/src/tomcatTest/java/io/grpc/servlet/TomcatTransportTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public void start(ServerListener listener) throws IOException {
9393
.setAsyncSupported(true);
9494
ctx.addServletMappingDecoded("/*", "TomcatTransportTest");
9595
tomcatServer.getConnector().addUpgradeProtocol(new Http2Protocol());
96+
// Workaround for https://github.com/grpc/grpc-java/issues/12540
97+
// Prevent premature OutputBuffer recycling by disabling facade recycling.
98+
// This should be revisited once the root cause is fixed.
99+
tomcatServer.getConnector().setDiscardFacades(false);
96100
try {
97101
tomcatServer.start();
98102
} catch (LifecycleException e) {

0 commit comments

Comments
 (0)