If we begin to shutdown the spring context while we receive the first HTTP request, spring-boot can deadlock.
It seems that the first HTTP request kicks off some initialization that grabs a lock on the AnnotationConfigEmbeddedWebApplicationContext.
We saw this in a production application, but I managed to replicate it with some success in a demo application:
https://github.com/magJ/spring-boot-deadlock-issue-4130/
It might take a few attempts, but the above application should deadlock eventually.
Spring boot version: 1.2.4-RELEASE
Java Version: 1.8.0_20
I also have a log sample and thread dump of what we saw in out prod application:
https://gist.github.com/magJ/21b075fe38fdace94be8