-
Notifications
You must be signed in to change notification settings - Fork 206
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
boot-java.live-information.automatic-tracking.on
is not working on vscode.
#733
Comments
VS Code Version: 1.64.2 Extension version |
Your boot app properties requires:
You should be able to connect to the app to see live information after the above properties are set. This is also the reason why automatic connection to process via JMX is off in vscode by default - we need to set these properties somehow when the launch configuration json is created. Eclipse STS variant sets these properties for the launch configuration as command line options hence STS boot LS can connect to the app's process. Long story short we need to contribute our command line options to the java launch config to make this work. |
Thank you for pointing this out.
Yes, then I can enable live information by manually selecting the process. Actually when launching from spring-boot-dashboard extension, above properties are automatically added into launch configuration. However, with Update: some context information |
Well... seems like we meant to remove |
Interesting. So previously when it was working, how do you determine which process to connect? And what's done in sts-eclipse? BTW, in spring-boot-dashboard extension, we simply construct a launch configuration with required properties and pass it to java debugger extension. |
We had sort of a "brute force" solution as far as I remember. It was scanning for all java processes running on the system and attempting to connect via JMX and read live info from each all the time every n seconds (that is if I remember this correctly). The performance of this wasn't great and therefore the current solution is let user control when to fetch live data. For this purpose we need to know where to fetch the data from. Thus the extension lets the user pick which java process to connect from the list of running java processes. Eclipse launch API lets us:
Anyway, the above allows to connect to the proper process in the case of Eclipse launch config app start. The VScode bit to achieve the same is yet to be done. |
@Eskibear finally figured it out. It appears that the "brute force" solution is still available via the
Very important to supply I think at the very least we can supply those 3 parameters above automatically with a VSCode launch extension. I'd try to go even further and connect to only one process rather than track all of them but this is to be determined. |
Should be fixed with 9ef209d |
Thanks for the info, and I can confirm that in sts-vscode v1.31.0, the auto-tracking feature gets back to work when providing |
The fix in 9ef209d is great! |
Hmm... I'd delegate this decision to @martinlippert. @Eskibear do you know if it is possible to get the process ID from the debug session? The process id is available on the LS side debug session but seems like this pid never reaches the ui (client side). If we had the pid we could connect directly to the boot app process and this would make auto connect setting to be true by default a no brainer. Otherwise we are faced to turn on process polling by default which may consume quite a bit of cpu. |
Yes, technically we can. If it's launched in So we can perserve the pid on debugger side, and client side can use |
Yes, we can switch that to |
With regards to the process ID: In case we can determine the process ID directly, we could also go down the path to directly tell the language server to connect live hovers for that process. For that case, I would tend to add a specific command param that contains the process ID - instead of reconstructing the name of the command that the language server generates for a Java process that it finds on the machine. That identifier was only be meant to be generated by the language server, then sent to the client, and sent back from the client to the language server (in case you want to connect manually to that specific process). The exact syntax of this generated name is not well defined and can change between platforms, JVMs, etc. So reconstructing that on the client side is dangerous. Instead, we could introduce the process ID as a command param directly into this game and therefore allow the language server to pick the exact process when the command to connect live hovers arrive. The language server could also include the process ID as a separate param in the generated command (for completeness). Happy to discuss this in further detail anytime @BoykoAlex |
I have moved the issue of connecting directly to the app here #738 |
Describe the bug
boot-java.live-information.automatic-tracking.on
is not working as described on vscode.To Reproduce
boot-java.live-information.automatic-tracking.on
to truemanage live spring boot process connections
, and pick the correct process, it fails after several retries.Sample
https://github.com/spring-projects/spring-petclinic
I remember long time ago it was working well and live information was shown by default. And I find this commit 2cecd45 changed its default value from
true
tofalse
. So what was the purpose to turn it off?The text was updated successfully, but these errors were encountered: