-
Notifications
You must be signed in to change notification settings - Fork 133
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
Allow a debuggee to be disconnected gracefully #196
Comments
@yannickowow yes, I think this feature request makes sense (and it was reported by @ericdrobinson too) |
Would this make sense to partially implement as a new feature? The I believe the issue I reported that @weinand is referring to is this one, but it is VS Code-specific and is specifically about VS Code's implementation of In this case, it seems that the request is to allow a "Graceful Disconnect" option, whereby there would be a two-stage disconnect request. I guess |
@yannickowow DAP's A hypothetical client could surface a There are two possible outcomes of the "Shut down debuggee gracefully" command:
Bottom line: from a DAP perspective "disconnect gracefully" is possible for the "vetoed" case, but it does not make sense for the un-vetoed case because a "terminate" means "terminate" and not just "disconnect". Now back to VS Code's implementation of this part of the spec: In VS Code calling the Since the ultimate goal of the However, recently we've added a new argument This bug is tracked as microsoft/vscode#143991 |
Correct, thanks for your clarifications. |
@weinand I think you may have misinterpreted the initial request. Specifically that request was for:
I read this as a feature request to add a
In the bolded part you seem to understand the request as something that depends upon the "terminate" request. Based on the section I quoted above, I think this is a mismatch. The initial request is for a completely parallel flow that would allow a user to attempt to disconnect an attached debuggee "gracefully". For instance, I send a Debuggee a message that says "I'm disconnecting from you" and the debuggee responds with "wait! Error!" then I can't gracefully disconnect (or I need to show a last-minute error). If the user were to hit the disconnect button again, then it would skip to the standard disconnect logic. This would only be the case if some new You will notice that my understanding has nothing to do with |
But you are making an assumption here about how all debuggers will work (I'm working on a debugger for which this doesn't make sense, but another interpretation does). You also allow users to click "Stop" instead of "Disconnect" from the Debug Controls when in an "Attach" session. That "Stop" is sent as a request to terminate (in the
You are making an assumption about how all debuggers/debuggees work. I'm working with a debuggee protocol that allows me to send a signal to terminate at any time, even if the debug adapter was |
@ericdrobinson since @yannickowow is the author of this request, I'm taking his comment as a confirmation that my interpretation was correct. For the other concerns please see microsoft/vscode#143991 (comment) |
On my side yes I assume that your description of this case is correct, especially since you've linked the related issue in VS Code which suits what was the point of this issue. The issue I mainly faced was the way VS Code implements this, since |
@yannickowow There are conflicts between your statement and what @weinand is describing, I think. You use the term "disconnect" twice in this sentence:
And I interpret that as: ... since [the disconnect button] does not wait for the There are two buttons in VSCode's UI: Disconnect and Stop. The There are two other reasons that I think you may be asking for something different:
This bug has nothing to do with enabling a Graceful Disconnect when the user hits the "detach command" (I assume that this is the "Disconnect" button in VSCode's UI). It is only about ensuring that the My understanding of this feature request was to add a second "Graceful [Ending]" option to the DAP. This would look like:
Item 2 above does not currently exist (to my knowledge) and it is what I understand this request to be about. |
Yes, I meant that the disconnect procedure in Visual Studio Code does not wait the disconnectRequest() response to close the entire session. Considering that, I think that the issue is on the client side, not the protocol by itself. My main concern in |
🤔 |
This is an implementation-level issue. Please note: the "graceful disconnect" introduced and discussed here is completely unrelated to the "graceful terminate" supported via the DAP
|
Understood! Thank you for the clarifications! |
Hello,
I would like to know it if would make sense to add the ability to disconnect (on attach mode) gracefully using the same behaviour as
terminateRequest
.My first guess would be if a debuggee has
supportsTerminateRequest
to true, the first detach command or stop command will triggerterminateRequest
(with an optional flag) instead ofdisconnectRequest
. When detaching, a debuggee can emit outputs and would be ignored if a client (such as VS Code) shutdowns immediately a debug session.Regards.
The text was updated successfully, but these errors were encountered: