-
Notifications
You must be signed in to change notification settings - Fork 737
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
Hot Code Replacement Question #21040
Comments
Yes, the More background: A detailed explanation is available in eclipse-openj9/openj9-docs#1352. Key points:
For migration details, refer to the Semeru Runtimes Migration Guide. |
@babsingh thank you for the explanation about the Extended HCR. But for me there are still a few things that are unclear. If i want to have Hot Code Replacement during a Debug Session in Eclipse/VSCode, must i enable this feature from now on ? And if so will the hot code replacement will be removed in future releases at all ? Thank you for any information ! |
Basic HCR and Extended HCR are distinct features. If you want to use Basic HCR during a debug session in Eclipse/VSCode, no additional configuration is required. It remains enabled by default in OpenJ9 and supports method body modifications. However, if you need Extended HCR (which allows structural changes like adding/removing methods or fields), you must explicitly enable it using Adding members more experienced with HCR to validate my statements: @jdmpapin, @gacholio. |
That's right. I'll just add that the restrictions we impose on (basic) HCR are the same ones that OpenJDK imposes. I'm curious, would you mind telling us what kind of simple code change is being rejected? The only case I know of where a change to a method body at the source level can add or remove methods at the bytecode level is when adding, removing, or reordering lambda expressions. |
@babsingh This is my understanding. |
@jdmpapin @gacholio thank you very much for the clarification! Now for me its more clear how HCR works and what the difference is between Basic and Extended. I have one easy scenario and maybe you can explain me if it is a valid behaviour of Basic HCR. I have following simple REST Endpoint
If i change the Method Body of sayHello() the HCR works fine.
But if i add a new Method to the Class
i see following log message
Now its clear to me why this message will be displayed (structural change). But from this point a change to the Method Body of sayHello() will not be picked up.
If i delete the new Method and bring the class file to its original structure the changes in the Method body will work again.
Is this a valid behaviour with Basic HCR ? |
The HCR operation is meant to be transactional, so either it completes successfully and makes all of the specified changes, or it fails and makes no changes (I'm assuming that you're adding the method and changing the other body in the same HCR request). |
To elaborate a little bit, @gacholio's point means that yes, that is the expected behaviour. You start with the original class. When you add |
@jdmpapin @gacholio thank you very much to clarify the HCM theme ! I haven't found any of this informations on https://eclipse.dev/openj9/docs, or i have not searched well .. |
@tajila are additional doc updates required to cover what was discussed here? |
We are intending to remove extended HCR, so it might be best not to discuss it too much, |
All the details are in https://eclipse.dev/openj9/docs/xxenableextendedhcr/. But perhaps it is not well understood what extended HCR is in the first place. |
Java -version output
openjdk version "21.0.5" 2024-10-15 LTS
IBM Semeru Runtime Open Edition 21.0.5.11 (build 21.0.5+11-LTS)
Eclipse OpenJ9 VM 21.0.5.11 (build openj9-0.48.0, JRE 21 Windows 10 amd64-64-Bit Compressed References 20241015_305 (JIT enabled, AOT enabled)
OpenJ9 - 1d58314
OMR - d10a4d553
JCL - b1b311c53fe based on jdk-21.0.5+11)
Summary of problem
We are developing with eclipse on openliberty. During a debug session the Hot Code Replacement (HCR) worked fine in the past. For a while now we have more and more the feeling that the HCR does not work anymore. (we had upgraded to the latest release)
Now i have tried to find out the exact circumstances. I have tried with IBM Semeru jdk-21.0.3+9_openj9-0.44.0 and with that version the code changes will be picked up correctly.
With the current release jdk-21.0.5+11_openj9-0.48.0 a simple code change will not be picked up anymore.
We see also following log entry
translation:
So the question is, is it mandatory now to set the System Property ? But as the log entry says it is a old function that will be removed.
Thanks for any help
The text was updated successfully, but these errors were encountered: