Skip to content
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

Restart stop but not start the program #752

Closed
llgcode opened this issue Jan 20, 2020 · 7 comments · Fixed by microsoft/java-debug#322
Closed

Restart stop but not start the program #752

llgcode opened this issue Jan 20, 2020 · 7 comments · Fixed by microsoft/java-debug#322
Assignees
Labels
Milestone

Comments

@llgcode
Copy link

llgcode commented Jan 20, 2020

Restart doesn't work, when hit restart button the process terminate but not restart.

Environment
  • Operating System: win10
  • JDK version: jdk1.8.0_112
  • Visual Studio Code version: 1.41.1
  • Java extension Pack version : 0.8.1
  • Java Debugger extension version: 0.24.0 - 2019-12-25
Current Result

Stop the program

Expected Result

Rerstart the program

@akaroml
Copy link
Member

akaroml commented Feb 7, 2020

@llgcode thanks for reaching out.

It would be very helpful if you could share a sample project with us. Even a very simplified version will help. Would you please provide that?

@llgcode
Copy link
Author

llgcode commented Feb 12, 2020

hi @akaroml,
I can't provide you my project, I've tried to create a sample project but can't reproduce the issue.
I found in Language Suport for Java output this warning when relaunching the program:

[Warn - 10:58:50 AM] Feb 12, 2020 10:58:50 AM Failed to destory launch files, will retry again.

@llgcode
Copy link
Author

llgcode commented Feb 12, 2020

I've reproduced the issue :-) in the sample project ! by setting this setting in launch.json

...
"shortenCommandLine": "jarmanifest",
...

Please found the sample project here:
java-ws-1.zip

@testforstephen
Copy link
Contributor

i can reproduce it with the sample project. thanks for reporting.

@testforstephen
Copy link
Contributor

this looks like an issue in the upstream, see microsoft/vscode#87767 (comment).

@testforstephen
Copy link
Contributor

The java debugger adds some step to clean up the temp files during handling the disconnect request. And considering the temp files may be occupied by the debuggee process, so the debug will retry 5 times for cleaning the temp files, the sleep interval for each retry is 1s.

On the other hand, vscode uses the 500ms timeout for disconnect request, see microsoft/vscode#87767 (comment). That means if the disconnect request handler in the debugger didn't return the response in 500ms, the debug session will shutdown instead of restart.

I've reproduced the issue :-) in the sample project ! by setting this setting in launch.json
...
"shortenCommandLine": "jarmanifest",
...

Failed to destory launch files, will retry again.

The user used jarmanifest option, the debugger will need clean up the temp manifest jar during disconnect request. From the log file, the debugger retried one more time to clean up the temp file, that means the debugger returned the response in at least 1s. This is beyond of the vscode limit.

The fix is to change the retry interval from 1s to 100ms, this will make the debugger to return the response in 500ms.

@llgcode
Copy link
Author

llgcode commented Feb 19, 2020

I hope it will work in my case.
Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants