Bug 567046 - Allow disabling hot code replace for individual launch / configurarion
Summary: Allow disabling hot code replace for individual launch / configurarion
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.18 M1   Edit
Assignee: Kris De Volder CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, plan
Depends on:
Blocks:
 
Reported: 2020-09-16 15:41 EDT by Kris De Volder CLA
Modified: 2020-10-29 15:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kris De Volder CLA 2020-09-16 15:41:00 EDT
There are preferences under "Window >> Java >> Debug" that control Hot Code Replace. E.g. "Enable Hot Code Replace", "Show Error when Hot code replace fails" etc.

Sadly these preferences can only disable hot code replace for the entire workspace and this is a bit too drastic for our purposes. 

The use case we have is that when launching spring boot application which has 'devtools' as a dependency we would rather count on devtools to reload the app when changes are detected on the classpath. This is done via a mechanism internal to the app and essentially just throws away existing classloader to fully reload the app 'in place'. When devtools is active therefore, hot code replace is not desirable as it doesn't really do anything (the hotswapped code will just be thrown out anyways). Similarlly errors and warnings about HCR failing are are not desirable either.

However, this doesn't mean we want to disable HCR altogether. We only want to disable it for those specific launches where devtools is enabled. In general however, HCR is a very useful feature and should remain enabled for the majority of launches.

I assume that at the moment there is no way to accomplish this? Or is there?
Comment 1 Kris De Volder CLA 2020-09-16 17:05:25 EDT
This small PR enables us to do what we want:

https://github.com/eclipse/eclipse.jdt.debug/pull/28

Please let me know if this can be accepted or if something else needs to be done to make it acceptable.

Thanks!
Comment 2 Kris De Volder CLA 2020-09-16 17:37:49 EDT
Just FYI... this is the commit in spring-ide where we depend on this PR:

https://github.com/spring-projects/spring-ide/commit/943f48ae2ffbff774f614c66267f0af33a6b67c6
Comment 3 Sarika Sinha CLA 2020-09-17 14:40:11 EDT
You just need a support at API level ? This is what I observe from the patch.
Meaning there is no need to add a support to 

Please provide a gerrit to proceed further.
Comment 4 Kris De Volder CLA 2020-09-18 14:46:42 EDT
> You just need a support at API level.

That is enough for us yes. We want our tooling to be able to disable the hotswap when we detect devtools dependency on launch.

> .. gerrit...

Okay sure, it is a bit of PITA TBH Github PR are so much more intuitive and easy to submit and process. For Gerrit I spend more time reading the manual and trying to guess the exact upstream remote url that will work than actually being productive and reading and adressing comments.

Of course I will do as you wish but I do not use gerrit often and will likely make some mistakes in the process, so please bare with me on that.

Also it would help if you can 

- tell me the remote url to use to push the change into so gerrit becomes aware
- link the instructions specific for JDT debug gerrit (if such instructions exist) or if they don't I can make do with generic instructions 

E.g these generic instructions are probably what I'd refer to (unless you can send better ones):

https://wiki.eclipse.org/Gerrit

I still remember from last time I used this that guessing the specific url to use from the generic pattern:

https://wiki.eclipse.org/Gerrit#Gerrit_push_URL

... can be somewhat trial and error. So it would help a lot if you told me the exact url to push into.

Or... if you don't mind, perhaps you can just review the GH PR instead? I thought the point of having the github mirror of the repo was precisely to make this more convenient workflow possible.
Comment 5 Eclipse Genie CLA 2020-09-18 15:36:54 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/169601
Comment 6 Kris De Volder CLA 2020-09-18 15:40:28 EDT
Okay, I think I was able to figure out / remember how to push a change to gerrit.

Link:

https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/169601
Comment 7 Sarika Sinha CLA 2020-09-22 01:18:21 EDT
It will be good to have a N&N entry describing the new property
News Repo -> www.eclipse.org/eclipse/news.git
Comment 9 Sarika Sinha CLA 2020-10-29 03:42:12 EDT
@Kris,
Can you add this in N&N ?
Comment 10 Kris De Volder CLA 2020-10-29 10:50:30 EDT
Okay, can you remind me which git repo the N&N lives on?
Comment 11 Sarika Sinha CLA 2020-10-29 15:06:04 EDT
(In reply to Kris De Volder from comment #10)
> Okay, can you remind me which git repo the N&N lives on?

www.eclipse.org/eclipse/news.git