This might be a Intellij specific problem but;

  1. Include dev tools in pom.xml
  2. Set On Update Action as "Update classes and resources" SpringBoot Application restarts twice on reload when both a class and property files changed

  3. Run application

  4. Change a property file and a class file
  5. Hit "Update" SpringBoot Application restarts twice on reload when both a class and property files changed

Application restarts then restarts again

`2021-02-13 21:40:08.127 DEBUG 8796 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Creating new Restarter for thread Thread[main,5,main] 2021-02-13 21:40:08.127 DEBUG 8796 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Immediately restarting application 2021-02-13 21:40:08.128 DEBUG 8796 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@4609f98d 2021-02-13 21:40:08.128 DEBUG 8796 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Starting application com.vebora.starttuptest.StarttuptestApplication with URLs [file:/C:/Users/Qualist-Orhan/workspace-orhan/starttuptest/target/classes/] 2021-02-13 21:40:23.537 DEBUG 8796 --- [ File Watcher] o.s.boot.devtools.restart.Restarter : Restarting application 2021-02-13 21:40:23.540 DEBUG 8796 --- [ Thread-6] o.s.boot.devtools.restart.Restarter : Stopping application 2021-02-13 21:40:23.541 DEBUG 8796 --- [ Thread-6] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@706581df, started on Sat Feb 13 21:40:05 EET 2021 2021-02-13 21:40:24.274 INFO 8796 --- [ Thread-6] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler' 2021-02-13 21:40:24.278 INFO 8796 --- [ Thread-6] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2021-02-13 21:40:24.389 DEBUG 8796 --- [ Thread-6] o.s.boot.devtools.restart.Restarter : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@372ee301 2021-02-13 21:40:24.389 DEBUG 8796 --- [ Thread-6] o.s.boot.devtools.restart.Restarter : Starting application

....

2021-02-13 21:40:25.078 INFO 8796 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged

================> THEN SECOND RESTART

2021-02-13 21:40:26.482 DEBUG 8796 --- [ File Watcher] o.s.boot.devtools.restart.Restarter : Restarting application 2021-02-13 21:40:26.483 DEBUG 8796 --- [ Thread-9] o.s.boot.devtools.restart.Restarter : Stopping application 2021-02-13 21:40:26.483 DEBUG 8796 --- [ Thread-9] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1d528d3b, started on Sat Feb 13 21:40:24 EET 2021 2021-02-13 21:40:27.417 INFO 8796 --- [ Thread-9] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler' 2021-02-13 21:40:27.417 INFO 8796 --- [ Thread-9] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2021-02-13 21:40:27.678 DEBUG 8796 --- [ Thread-9] o.s.boot.devtools.restart.Restarter : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@7564a821 2021-02-13 21:40:27.679 DEBUG 8796 --- [ Thread-9] o.s.boot.devtools.restart.Restarter : Starting application

.....

2021-02-13 21:40:28.156 INFO 8796 --- [ restartedMain] c.v.s.StarttuptestApplication : Started StarttuptestApplication in 0.461 seconds (JVM running for 25.192) App started :2021-02-13T21:40:28.157 2021-02-13 21:40:28.158 INFO 8796 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged`

Comment From: wilkinsona

This looks very similar to https://github.com/spring-projects/spring-boot/issues/12760. Please try configuring a longer quiet period using spring.devtools.restart.quiet-period. The default is 400ms and I suspect there's a more than 400ms gap between resource processing completing and compilation writing new class files.

Comment From: arikanorh

When i set it to be 1000 then application doesnt start and give error

Caused by: java.lang.IllegalArgumentException: PollInterval must be greater than QuietPeriod

Comment From: snicoll

@arikanorh thanks for trying. The exception message states that poll interval must be higher than the quiet period. Poll interval is 1sec by default so you may have to increase it according to the exception message. The documentation can be helpful as well.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.