vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Bogus "Canceled" error message when stopped debugging in certain scenarios

Open edumunoz opened this issue 10 years ago • 5 comments

  • VSCode Version: 1.2.1
  • OS Version: All

Steps to Reproduce:

  1. Start debugging with a debug adapter which won't send a response (e.g., there's a bug in the debug adapter, or the debug adapter is waiting for an external event (attaching a debugger to it)) for a request from VSCode.
  2. When stopping the debug session (disconnect request), there is an error popping up in the VSCode UI that reads "Canceled".

image

Expected: debugging stops cleanly as far as the user can tell.

I spent a short amount of time looking into this to see if the error message was coming from the debug adapter somehow. I found that the disconnect request calls cancel() on all sent promises. https://github.com/Microsoft/vscode/blob/c5429332d4ac326a94a6c5e87fffefcb14d10e84/src/vs/workbench/parts/debug/node/rawDebugSession.ts#L261

This is the exception that is causing the error in the VSCode UI https://github.com/Microsoft/vscode/blob/bfb5b806e4f0328102bde3fd8750e63c66c2f19a/src/vs/base/common/winjs.base.raw.js#L1654

It doesn't seem like the promises that are being pushed into sentPromises have an onCancel() handler https://github.com/Microsoft/vscode/blob/81050abedbe54597b9506609eb5b7cb916ddc9c6/src/vs/workbench/parts/debug/node/v8Protocol.ts#L44 https://github.com/Microsoft/vscode/blob/bfb5b806e4f0328102bde3fd8750e63c66c2f19a/src/vs/base/common/winjs.base.d.ts#L64

@isidorn

edumunoz avatar Jun 20 '16 23:06 edumunoz

@edumunoz thanks for the nice analysis.

isidorn avatar Jun 21 '16 09:06 isidorn

I'm still seeing the issue with these steps:

  • launch vscode-node-debug as a server
  • set a breakpoint in nextRequest
  • add the debugServer: 4711 to your launch config
  • start a node debug session
  • press the step' button (breakpoint is hit in node-debug)
  • press 'stop' button: 2016-07-04_13-02-10

weinand avatar Jul 04 '16 11:07 weinand

Will investigate - not critical, assigning to july

isidorn avatar Jul 04 '16 11:07 isidorn

I'm writing a debug adapter and am getting this message in 1.3.1, is this something that will be patched, or possibly an error in my adapter code, my disconnect request only calls clearInterval(this._timer); super.disconnectRequest(response, args);. Everything works fine, I just get that error message, my code, or being patched?

edencorbin avatar Aug 01 '16 21:08 edencorbin

This issue was assigned to July and that milestone has not been released yet. So it will be fixed in 1.4, or you can use our insiders release which already has the fix.

isidorn avatar Aug 02 '16 07:08 isidorn