-
Notifications
You must be signed in to change notification settings - Fork 768
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
debug: fix and expand extension logging for dlv-dap and process teardown #1410
Comments
Playing with
Debug session 1 outputs:
Debug session 2 outputs:
|
Please follow the troubleshooting guide and include the dlv-dap's version information. Edit: the log message in the original report is from vscode-go/src/goDebugFactory.ts Line 356 in 92cdf32
But I see the value of showing the program exit status - let's place back a log. And inconsistent logging - we need the dlv-dap version. I suggest to check this issue after go-delve/delve#2414 is merged. |
|
I am not worried about inconsistent logging from the delve side. I only included it to show that perhaps the timing of how delve exited impacted the status logging from the extension side. The above log only included debugger logging. If you turn on dap logging as well, you will see that after continue, there are the following things happening:
And sometimes the log ends there. Other times you get some or all of these
The disconnect handler right now uses fire-and-forget approach: the disconnect response is sent first, and then the rest of the teardown happens. So if the client gets the disconnect response before all the halting and detaching, it will disconnect. Or maybe the last couple of logging messages don't get flushed in time. This reminds me though that I have been meaning to move the disconnect response to after we detached. That should bring more consistency here and we could even sent back errors. But in either case, we would not know any of this, unless dlv-dap logging was on. So we really do need the extension to tell us from its end if things have exited and with what status. This was also the reason why "process has exited with status" message was error-logged from delve, so we get it no matter what, but that was changed in go-delve/delve#2412. Perhaps we should consider bringing it back. |
Change https://golang.org/cl/310751 mentions this issue: |
Change https://golang.org/cl/310750 mentions this issue: |
And create a `Go Debug` output channel that can be used to output all logging and traces from debug extension activity. Logging level of individual debug session is controlled by launch configuration's `trace` attribute. Manually tested. Update #1410 Change-Id: Ib87d014ec6114581af78bdcdd74b190b14552ce6 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/310750 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
When the dlv-dap server is started by the extension, the extension manages its lifecycle. For troubleshooting sticky situations and identifying issues, it would be great if it logged when the server is being shutdown from the extension side. We do have shutdown logging in dlv-dap, but that assumes that dlv-dap is shutting down cleanly and that dlv-dap chatty logging is on. That won't help us with cases where dlv is unresponsive or has crashed (potentially with the child process still lingering), so the extension needs to be doing some force-cleanup.
We already print at start-up
And sometimes I see this, but it seems very inconsistent:
It would be great if there was a reliable message at the end, whether things exited normally or not, both on the process and the debugger side. We could print something short by default and have additional details if "trace" attribute is on.
The text was updated successfully, but these errors were encountered: