For T388416, we would need a stacktrace of some sort. I have looked a bit at NodeJS debugging earlier today.
It seems we can pass command line options by setting them in the NODE_OPTIONS environment variable. So that can be done from Zuul parameters_functions.py for the set of jobs we want to affect.
Options that looks interesting:
Debugger Sending SIGUSR1 starts the debugger listening on a websocket listening on 127.0.0.1. The URL to use is emitted to the console. One can attach to it using Chrome (browse to chrome://inspect) No idea how we could attach to it when it is running inside a container -- https://nodejs.org/en/learn/getting-started/debugging
Linux perf, which allows so many things. I don't use it often but it should do the job. NodeJS would have to be started with some of the options it has for perf. Eg: NODE_OPTIONS=--perf-basic-prof -- https://nodejs.org/en/learn/diagnostics/poor-performance/using-linux-perf#using-linux-perf
heapsnapshot, I am not sure it is much relevant https://nodejs.org/en/learn/diagnostics/memory/using-heap-snapshot/
gdb, I have blogged about it J306 after I have successfully investigated a segfault that happened inside a container.