profile
viewpoint

Ask questionsNot restart debugging

Issue Type: <b>Bug</b>

Debug a Python script; Stop at a breakpoint; Then hit restart, but nothing happened.

Extension version: 2019.11.49689 VS Code version: Code 1.40.1 (8795a9889db74563ddd43eb0a897a2384129a619, 2019-11-13T16:47:44.719Z) OS version: Darwin x64 18.7.0 Remote OS version: Linux x64 3.10.0-957.5.1.el7.x86_64

<details> <summary>System Info</summary>

Item Value
CPUs Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)
GPU Status 2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_renderer: disabled_off<br>surface_control: disabled_off<br>surface_synchronization: enabled_on<br>video_decode: enabled<br>viz_display_compositor: enabled_on<br>viz_hit_test_surface_layer: disabled_off<br>webgl: enabled<br>webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 32.00GB (15.43GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote SSH: compy
OS Linux x64 3.10.0-957.5.1.el7.x86_64
CPUs Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz (80 x 1000)
Memory (System) 187.36GB (100.51GB free)
VM 0%

</details> <!-- generated by issue reporter -->

microsoft/ptvsd

Answer questions int19h

There are no errors or really anything unusual in ptvsd logs here, but this gets logged by VSC in Output -> Log (Window):

[2019-11-21 15:30:23.432] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms
    at t.RawDebugSession.handleErrorResponse (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:1003)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:434
    at async t.RawDebugSession.shutdown (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2796:536)
    at async R.terminate (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:5173:637)
    at async q.restartSession (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:5197:851)

which corresponds to: https://github.com/microsoft/vscode/blob/a318b97373602cf81fc146ff93547f5fae7cd417/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts#L478-L491

So, the problem is that IDE gives us 500 ms to terminate, and after that considers it an error. The problem is that it takes us longer to fully handle a graceful shutdown - in my repro, around 600 ms from the moment we receive "disconnect", to the moment we respond to it.

The error itself occurs when using "Stop" as well, but in that case the only side effect is it being logged by VSC. However, if using "Restart", VSC will simply not proceed if it failed to stop the process. It also doesn't display any error message, so if you don't have the log window opened, there's no indication as to what went wrong.

useful!
source:https://uonfu.com/
Github User Rank List