We’ve found the root cause of our issue.
The relevant code is here: https://github.com/microsoft/vscode-node-debug2/blob/master/src/nodeDebugAdapter.ts#L824
In case of “console”: “integratedTerminal” parameter (default is “console”: “internalConsole”) the debugger asks the debugged process what is the pid and performs polling in startPollingForNodeTermination(). In our case, the process runs in a different container, so the debugger can’t find the process and terminates the debug session.
Thank you so much for your promptly assistance, Anton!