-
Notifications
You must be signed in to change notification settings - Fork 68
"Debug Console" is missing some output with joblib.Parallel #1658
Comments
Output redirection is done by detouring |
Oh, actually, the reason is that it uses multiple processes, and the debugger does not automatically attach to child processes. Try doing this in your launch.json: "subProcess": true, |
|
There seem to be several unrelated issues here that combine to produce this effect. Firstly, the UX. Every process gets its own Debug Console, which means that as the child process starts printing, it switches to the new Debug Console for that process. So it doesn't actually clear the text - it just looks like it, because of the switch (but you can see that it's a different pane, in the combo box). It's not entirely clear to me what we can do about this in general - but for "launch" scenarios, at least, the fix for #1659 will also have the side effect that it'll capture the output of all subprocesses that share stdout/err with the main process, and direct it to the same pane. Then there appears to be some actual bug with Debug Console, where it loses text that was already written there? I'm not entirely sure what's causing it, but this feels like a core VSCode issue. @DonJayamanne, you might want to route that one accordingly - we certainly don't control this beyond producing "output" events for the Debug Console to consume, which it does here. There also might be an issue in that the output of the child processes is not fully captured (or rather, captured, but not sent) before they exit. This was discussed in #1585 (comment), where we had to make workarounds for it in tests. We haven't actually seen this in production before, but I can see how this specific pattern of multiproc might cause it. Again, #1659 will fix it for launch, but we still need to come up with a solution for attach, if the attached process exits while it's being debugged. |
@bersbersbers In the meantime, I recommend you use this: "console": "integratedTerminal", This way, the output of all processes will also be printed in VSCode terminal, and it'll be a single stream for all of them (it will also still go to Debug Console, with all these warts - but you can ignore that). |
Thank you for the investigation and explanation, and good luck tackling all of this. I will try that workaround (it does indeed work), although I prefer the debug console over the terminal. |
Closing this issue since we have addressed #1659. It might take some time before this fix is released. For the extension specific issues if they continue to exists please file bugs on the extension. |
Environment data
joblib==0.13.2
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version vscode-python#3977): JediExpected behaviour
Actual behaviour
Steps to reproduce:
Run this code with
"console": "internalConsole",
in the launch configuration, observe output in Debug console:Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)With higher verbosity, this is the output:
The text was updated successfully, but these errors were encountered: