vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
603 stars 165 forks source link

24.4 startup times with JRebel are immense #19459

Open stefanuebe opened 3 months ago

stefanuebe commented 3 months ago

Description of the bug

Beginning with 24.4 it can take a huge amount of time until the application starts to even load the spring basics, when starting it with JRebel debug. I am not sure, why this happens, but it did not happen with 24.3.x.

The application load stucks "forever" on

Connected to the target VM, address: '127.0.0.1:51647', transport: 'socket'

Restarting a few times helps most times, that with the 3rd-4th restart it immediately loads up.

It seems to be irrelevant, which JDK is used. I have the same issue with Amazon's Corretto 17 and Oracle's OpenJDK 22. IDE is Intellij.

Expected behavior

The startup should be as "fast" as with 24.3.

Minimal reproducible example

Download a plain starter project. Change the version to 24.4.0.beta5. Start the application, using JRebel debug.

Wait...

Restart multiple times. Sometimes it is faster, sometimes it takes "hours".

Versions

stefanuebe commented 3 months ago

Might be related to https://github.com/vaadin/flow/issues/19261

stefanuebe commented 3 months ago

After adding an explicit rebel.xml (generated using the JRebel plugin) in the resources folder it seems like the startup delay is more or less gone. But this might be a coincidence.

image
stefanuebe commented 3 months ago

After a dozen of starts I can say, that having an explicit rebel.xml fixed it for me.

stefanuebe commented 3 months ago

With the latest 24.4.1 it came back. So still something to investigate I assume. :(

vesanieminen commented 2 months ago

I'm experiencing this issue as well. Here's a project you can reproduce it: jrebel issue.zip Steps to reproduce:

  1. Run mvn spring-boot:run and observe that the app runs fine.
  2. Debug with JRebel and you will notice a slow start up or maybe even having the build get completely stuck
  3. Debug without JRebel and notice it works fine
  4. Run with JRebel and without debug and it works fine as well

P.S. you might want to remove my rebel.xml file from src/main/resources. This issue reproduces with or without a local rebel.xml file.

FollowSteph commented 1 month ago

I too had to create a rebel.xml file to resolve this issue.

stefanuebe commented 1 month ago

Any updates on this one? Some 24.4 projects are basically unusable with JRebel more or less (still cannot say why some projects seem to work with a rebel.xml while others never startup, regardless of the project setup)

FollowSteph commented 1 month ago

I've been in contact with Jrebel and in their last communication they suggested this which worked: Disable the Reactive Debugger feature in IntelliJ,. (File → Settings → Languages & Frameworks → Reactive Streams → uncheck “Enable Reactor Debug mode” checkbox). I'm in the process of following up as to why this is required and so on. Hopefully that helps you and any others experiencing this issue as well. The rebel.xml file trick worked for me for a bit then then stopped working. So far this new suggestion seems to be working consistently.

stefanuebe commented 3 weeks ago

I've been in contact with Jrebel and in their last communication they suggested this which worked: Disable the Reactive Debugger feature in IntelliJ,. (File → Settings → Languages & Frameworks → Reactive Streams → uncheck “Enable Reactor Debug mode” checkbox). I'm in the process of following up as to why this is required and so on. Hopefully that helps you and any others experiencing this issue as well. The rebel.xml file trick worked for me for a bit then then stopped working. So far this new suggestion seems to be working consistently.

Tried it now with two different projects (one very large and a small one) and it seems to be the solution. Thank you very much <3

@mshabarov maybe we should take this into the documentation in the JRebel chapter?

mshabarov commented 3 weeks ago

Worth it to add, yes. Thanks, @stefanuebe and @FollowSteph

mshabarov commented 2 weeks ago

Documentation has been updated. Is there anything that we can/should investigate regarding JRebel, or can we close this ticket ?