-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Make Devtools file detection more resilient across application restarts #19543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This can be also reproduced with getting a project from start.spring.io (instead of steps 1 & 2) using https://start.spring.io/#!platformVersion=2.2.2.RELEASE&dependencies=vaadin,devtools |
I was able to reproduce this with a sleep of 2 and 3 on my machine. It seems like a bug to me. Flagging for team attention to see how the rest of the team think we can fix it. |
…Boot Devtools issue (#655) Spring Boot Devtools issue (spring-projects/spring-boot#19543)
Digging into this today and the problem is with the way
This means that the application is in a failed state and needs a restart, but the file watcher doesn't trigger one because it thinks that the |
I think I have a fix for this, but it's a bit risky for 2.2.x. I'm going to move this one to 2.4.x. |
…Boot Devtools issue vaadin/spring#655 Spring Boot Devtools issue (spring-projects/spring-boot#19543)
To reproduce the problem
mvn
mv target/classes/com/packagename/myapp/MainView.class . ; sleep 2 ; mv MainView.class target/classes/com/packagename/myapp/MainView.class
instead of the expected view
Note that
sleep 2
is dependent on how fast your machine is. On my recent Macbook Pro,2
is a suitable time to sleep.If the delay is too short, then devtools will wait for both the removal of the old class and addition of the new class before restarting and the view will be available. If the delay is too long, then devtools will first restart once after the removal and then notice the new class later and restart again. Thus the view will also be available in the end although missing on one reload in between.
When the time is just right, devtools will fail to notice that the class has been added and will just restart the application without the class
Adjusting
and
to some degree helps this but is no generic solution as working and broken values are dependent on the speed and load of the development machine.
Now this is not just academic but at least IntelliJ IDEA apparently works like this: first the class is removed and then a new one is created.
The text was updated successfully, but these errors were encountered: