Closed
Description
Description
When I clicked the disconnect debug session button in Theia, 2 disconnect requests are sent to debug adapter. Since the first disconnect request already closes the debug adapter JSON RPC server to Delve, the second disconnect request will hang when it attempts to contact Delve through the closed JSON RPC server.
From the logs, it seems that the second disconnectRequest
is coming after the terminateRequest
.
Repro
- Clones a Go program (for example: https://github.com/GoogleCloudPlatform/cloud-code-samples/tree/master/golang/go-hello-world).
- Runs the program in Delve through a terminal:
dlv debug --continue --accept-multiclient --api-version=2 --headless --listen=:3456 --log
- Connects to it by creating a configuration:
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 3456,
"host": "127.0.0.1",
"cwd": "${workspaceFolder}"
}
- Clicks disconnect.
Logs
[18:42:07.342 UTC] AttachRequest [18:42:07.343 UTC] Start remote debugging: connecting 127.0.0.1:3456 [18:42:07.789 UTC] To client: {"seq":0,"type":"event","event":"initialized"} [18:42:07.790 UTC] InitializeEvent [18:42:07.790 UTC] To client: {"seq":0,"type":"response","request_seq":2,"command":"attach","success":true} [18:42:07.836 UTC] From client: setExceptionBreakpoints({"filters":[]}) [18:42:07.836 UTC] To client: {"seq":0,"type":"response","request_seq":3,"command":"setExceptionBreakpoints","success":true} [18:42:08.009 UTC] From client: configurationDone({}) [18:42:08.011 UTC] ConfigurationDoneRequest [18:42:08.056 UTC] To client: {"seq":0,"type":"response","request_seq":4,"command":"configurationDone","success":true} [18:42:08.057 UTC] ConfigurationDoneResponse {"seq":23,"type":"response","request_seq":4,"command":"configurationDone","success":true} [18:42:08.196 UTC] From client: threads({}) [18:42:08.211 UTC] To client: {"seq":0,"type":"response","request_seq":5,"command":"threads","success":true,"body":{"threads":[{"id":1,"name":"Dummy"}]}} [18:42:08.384 UTC] From client: stackTrace({"startFrame":0,"levels":20,"threadId":1}) [18:42:08.386 UTC] StackTraceRequest [18:42:08.424 UTC] To client: {"seq":0,"type":"response","request_seq":6,"command":"stackTrace","success":false,"message":"Unable to produce stack trace as the debugger is running","body":{"error":{"id":2004,"format":"Unable to produce stack trace as the debugger is running","showUser":true}}} [18:42:31.501 UTC] From client: disconnect({}) [18:42:31.504 UTC] DisconnectRequest [18:42:31.509 UTC] Closing Delve. [18:42:31.511 UTC] Remote Debugging: close dlv connection. [18:42:31.513 UTC] DisconnectRequest to parent to shut down protocol server. [18:42:31.513 UTC] To client: {"seq":0,"type":"response","request_seq":7,"command":"disconnect","success":true} [18:42:31.514 UTC] DisconnectResponse [18:42:32.063 UTC] From client: terminate(undefined) [18:42:32.064 UTC] To client: {"seq":0,"type":"response","request_seq":-1,"command":"terminate","success":true} [18:42:32.064 UTC] From client: disconnect(undefined) [18:42:32.065 UTC] DisconnectRequest [18:42:32.066 UTC] Skip disconnectRequestHelper as Delve's connection is already closed. [18:42:32.067 UTC] DisconnectRequest to parent to shut down protocol server. [18:42:32.067 UTC] To client: {"seq":0,"type":"response","request_seq":-1,"command":"disconnect","success":true} [18:42:32.068 UTC] DisconnectResponse [18:42:36.508 UTC] DisconnectRequestHelper timed out after 5s.