{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/38440","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/38440/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/38440/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/38440/events","html_url":"https://github.com/Microsoft/vscode/issues/38440","id":274264423,"number":38440,"title":"Debugger API - threadsRequest method is fired even after TerminatedEvent is sent","user":{"login":"DonJayamanne","id":1948812,"avatar_url":"https://avatars2.githubusercontent.com/u/1948812?v=4","gravatar_id":"","url":"https://api.github.com/users/DonJayamanne","html_url":"https://github.com/DonJayamanne","followers_url":"https://api.github.com/users/DonJayamanne/followers","following_url":"https://api.github.com/users/DonJayamanne/following{/other_user}","gists_url":"https://api.github.com/users/DonJayamanne/gists{/gist_id}","starred_url":"https://api.github.com/users/DonJayamanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonJayamanne/subscriptions","organizations_url":"https://api.github.com/users/DonJayamanne/orgs","repos_url":"https://api.github.com/users/DonJayamanne/repos","events_url":"https://api.github.com/users/DonJayamanne/events{/privacy}","received_events_url":"https://api.github.com/users/DonJayamanne/received_events","type":"User","site_admin":false},"labels":[{"id":256129993,"url":"https://api.github.com/repos/Microsoft/vscode/labels/bug","name":"bug","color":"8D6673","default":true},{"id":291054922,"url":"https://api.github.com/repos/Microsoft/vscode/labels/debug","name":"debug","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":{"login":"isidorn","id":1926584,"avatar_url":"https://avatars2.githubusercontent.com/u/1926584?v=4","gravatar_id":"","url":"https://api.github.com/users/isidorn","html_url":"https://github.com/isidorn","followers_url":"https://api.github.com/users/isidorn/followers","following_url":"https://api.github.com/users/isidorn/following{/other_user}","gists_url":"https://api.github.com/users/isidorn/gists{/gist_id}","starred_url":"https://api.github.com/users/isidorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isidorn/subscriptions","organizations_url":"https://api.github.com/users/isidorn/orgs","repos_url":"https://api.github.com/users/isidorn/repos","events_url":"https://api.github.com/users/isidorn/events{/privacy}","received_events_url":"https://api.github.com/users/isidorn/received_events","type":"User","site_admin":false},"assignees":[{"login":"isidorn","id":1926584,"avatar_url":"https://avatars2.githubusercontent.com/u/1926584?v=4","gravatar_id":"","url":"https://api.github.com/users/isidorn","html_url":"https://github.com/isidorn","followers_url":"https://api.github.com/users/isidorn/followers","following_url":"https://api.github.com/users/isidorn/following{/other_user}","gists_url":"https://api.github.com/users/isidorn/gists{/gist_id}","starred_url":"https://api.github.com/users/isidorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isidorn/subscriptions","organizations_url":"https://api.github.com/users/isidorn/orgs","repos_url":"https://api.github.com/users/isidorn/repos","events_url":"https://api.github.com/users/isidorn/events{/privacy}","received_events_url":"https://api.github.com/users/isidorn/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-11-15T18:49:17Z","updated_at":"2017-11-15T22:45:07Z","closed_at":"2017-11-15T22:45:07Z","author_association":"CONTRIBUTOR","body":"In the [Python extension](/Microsoft/vscode-python) we're seeing the threadsRequest method is being invoked even after the TerminatedEvent is sent by the Debug Apdater.\r\n\r\nThe flow is as follows:\r\n- Debug a python program\r\n- The python program ends, and this is detected by the debug adapter\r\n- The debug adapter then sends a `TerminatedEvent`, \r\n- Next the `disconnectRequest` gets invoked and a response is sent to this\r\n- Immediately after the above, the `threadsRequest` method is invoked\r\n\r\nThis causes the code to fall over, as the process no longer exists.\r\n\r\nI've checked out the [sample debugger code](https://github.com/Microsoft/vscode-mono-debug/blob/master/src/MonoDebugSession.cs#L706) and can see we have a check to see whether the process exists.\r\n\r\nShouldn't VS Code, stop sending these requests to the debug adapter. \r\nOr is it merely a timing issue (i.e. the `threadsRequest` had already been dispatched by vscode before it received the `TerminatedEvent`?\r\n\r\nIf it's the latter, then please feel free to close this issue. "},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/344754646","html_url":"https://github.com/Microsoft/vscode/issues/38440#issuecomment-344754646","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/38440","id":344754646,"user":{"login":"isidorn","id":1926584,"avatar_url":"https://avatars2.githubusercontent.com/u/1926584?v=4","gravatar_id":"","url":"https://api.github.com/users/isidorn","html_url":"https://github.com/isidorn","followers_url":"https://api.github.com/users/isidorn/followers","following_url":"https://api.github.com/users/isidorn/following{/other_user}","gists_url":"https://api.github.com/users/isidorn/gists{/gist_id}","starred_url":"https://api.github.com/users/isidorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isidorn/subscriptions","organizations_url":"https://api.github.com/users/isidorn/orgs","repos_url":"https://api.github.com/users/isidorn/repos","events_url":"https://api.github.com/users/isidorn/events{/privacy}","received_events_url":"https://api.github.com/users/isidorn/received_events","type":"User","site_admin":false},"created_at":"2017-11-15T22:45:07Z","updated_at":"2017-11-15T22:45:07Z","author_association":"CONTRIBUTOR","body":"VSCode should not send an threadsRequest after a terminatedEvent, it might be a timing issue.\r\n@DonJayamanne Since you have a reproducable on your machine feel free to place a breakpoint [here](https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts#L364) and check the callstack\r\n\r\nThough looking at all the possible callers it can only be a timing issue. Thus closing until proven otherwise."}}
{"actor":{"display_login":"isidorn"}}