Skip to content

Auto-configured customizers are stil applied on a user-defined ServletWebServerFactory #24574

@plilja

Description

@plilja

This bug occurs if you are using Jetty and Spring Boot version 2.4.1.

If you set a custom ThreadPool on your JettyServletWebServerFactory, then that thread pool was used for http requests in 2.2.0. After upgrading to version 2.4.1 that thread pool is no longer being used.

I.e. somewhere in your setup you have this code and you would expect the thread pool to be used.

    @Bean
    JettyServletWebServerFactory jettyServletWebServerFactory(QueuedThreadPool queuedThreadPool) {
        JettyServletWebServerFactory jettyServletWebServerFactory = new JettyServletWebServerFactory();
        jettyServletWebServerFactory.setThreadPool(queuedThreadPool); // Customized thread pool
        return jettyServletWebServerFactory;
    }

I've created a sample project that replicates the bug:
https://github.com/plilja/spring-boot-threadpool-bug
You can switch Spring boot version in that project to see that this worked in 2.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions