On Wed, 2022-05-18 at 16:26 +0200, Michael Osipov wrote:
> Am 2022-05-18 um 15:23 schrieb Oleg Kalnichevski:
> > Hi Michael
> > 
> > Could you please try the latest 1.8, 11, and 17 JDKs and see if the
> > issue is consistently reproducible across all versions or is
> > specific
> > to some.
> 
> I see the failure consistently on all Java versions:

...


> The server has plenty of resources and is mostly idle. I guess the 
> thread per process limit is reached. I don't understand why it needs
> to 
> scale that high for the test.
> 
> Do you need a thread dump at the time of the OOM?
> 
> M
> 

Could you please run this test with HttpCore master and let me know if
it exhibits the same issue?

---
import org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer;
import org.apache.hc.core5.http.protocol.UriPatternMatcher;
import org.apache.hc.core5.http2.HttpVersionPolicy;
import org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap;
import org.apache.hc.core5.io.CloseMode;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.util.Timeout;
import org.junit.Rule;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.Extensions;
import org.junit.jupiter.migrationsupport.rules.ExternalResourceSupport;
import org.junit.rules.ExternalResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Extensions({@ExtendWith({ExternalResourceSupport.class})})
public class H2ServerTest {

    private final Logger log = LoggerFactory.getLogger(getClass());

    private static final Timeout TIMEOUT = Timeout.ofSeconds(30);

    private HttpAsyncServer server;

    @Rule
    public ExternalResource serverResource = new ExternalResource() {

        @Override
        protected void before() throws Throwable {
            log.debug("Starting up test server");
            server = H2ServerBootstrap.bootstrap()
                    .setLookupRegistry(new UriPatternMatcher<>())
                    .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
                    .setIOReactorConfig(
                            IOReactorConfig.custom()
                                    .setSoTimeout(TIMEOUT)
                                    .build())
                    
.setStreamListener(LoggingHttp1StreamListener.INSTANCE_SERVER)
                    .setStreamListener(LoggingH2StreamListener.INSTANCE)
                    .setIOSessionDecorator(LoggingIOSessionDecorator.INSTANCE)
                    .setExceptionCallback(LoggingExceptionCallback.INSTANCE)
                    .setIOSessionListener(LoggingIOSessionListener.INSTANCE)
                    .register("*", () -> new EchoHandler(2048))
                    .create();
        }

        @Override
        protected void after() {
            log.debug("Shutting down test server");
            if (server != null) {
                server.close(CloseMode.GRACEFUL);
            }
        }

    };

    @RepeatedTest(5000)
    public void testSequentialRequests() throws Exception {
        server.start();
    }

}



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to