• Phillip Webb's avatar
    Restore original embedded container shutdown order · f08f8727
    Phillip Webb authored
    Update EmbeddedWebApplicationContext so that the servlet container is
    shutdown after the context is closed. Unfortunately shutting the
    container down before the context has been closed causes exceptions if
    the `/shutdown` actuator endpoint is used. It can also cause the Tomcat
    classloader to throw IllegalStateExceptions if resources are accessed
    during shutdown.
    
    As this commit effectively reverts 0069e41c we need to fix the shutdown
    deadlock issue reported in gh-4130 in a different way. The deadlock can
    be caused when an incoming HTTP connection occurs whilst the context is
    closing. The incoming connection triggers the `FrameworkServlet` to
    call `initWebApplicationContext` which in turn calls `refresh`. The
    `FrameworkServlet` checks `ApplicationContext.isActive()` before
    performing an initialization but prior to this commit we would set
    active to `false` before stopping the servlet container. We now override
    `onClose` rather than `doClose` in `EmbeddedWebApplicationContext` to
    ensure that the active flag is only set to `false` once the servlet
    container has been stopped.
    
    See gh-4130
    Fixes gh-4396
    f08f8727
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
spring-boot-versions Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...