flow icon indicating copy to clipboard operation
flow copied to clipboard

24.4 startup times with JRebel are immense

Open stefanuebe opened this issue 1 year ago • 11 comments

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

  • Vaadin / Flow version: 24.4.0.beta5
  • Java version: 22 (Oracle OpenJDK) and 17 (Amazon Corretto), but I assume the JDK is irrelevant?
  • OS version: Windows 10
  • Application Server: Spring Boot with Tomcat
  • IDE: Intellij IDEA

stefanuebe avatar May 27 '24 10:05 stefanuebe

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

stefanuebe avatar May 27 '24 10:05 stefanuebe

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 avatar May 29 '24 11:05 stefanuebe

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

stefanuebe avatar May 30 '24 04:05 stefanuebe

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

stefanuebe avatar Jun 14 '24 07:06 stefanuebe

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.

vesanieminen avatar Jun 25 '24 09:06 vesanieminen

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

FollowSteph avatar Jul 27 '24 01:07 FollowSteph

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)

stefanuebe avatar Aug 15 '24 11:08 stefanuebe

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.

FollowSteph avatar Aug 16 '24 16:08 FollowSteph

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?

stefanuebe avatar Aug 19 '24 07:08 stefanuebe

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

mshabarov avatar Aug 20 '24 07:08 mshabarov

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

mshabarov avatar Aug 26 '24 07:08 mshabarov