pulumi-awsx icon indicating copy to clipboard operation
pulumi-awsx copied to clipboard

Runaway Node process consuming CPU

Open t0yv0 opened this issue 2 years ago • 2 comments

What happened?

When running example tests in this repo I noticed 3 very long-running node processes consuming CPU on my Mac machine. This seems to be Pulumi Node language hosts as far as I can tell and they're orphan processes in the sense that their process group has terminated. I think something must be wrong with self-destruct/heartbeat machinery. Not filing it to pulumi/pulumi yet as this provider is special as the provider itself is written in Node and possibly is the culprit here.

ps -eaf | grep 76892                                                                                                                                                                        ~/code/pulumi-awsx/examples/ecs/nodejs
  502 76892     1   0 Fri01PM ??       364:50.85 /Users/t0yv0/bin/node /private/var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/p-it-antons-mac-ts-lb-simp-6b81ed54-1927854174/node_modules/@pulumi/pulumi/cmd/run/index.js --monitor 127.0.0.1:59921 --engine 127.0.0.1:59916 --sync /var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/pulumi-node-pipes188323378 --organization organization --project ts-lb-simple --stack p-it-antons-mac-ts-lb-simp-6b81ed54 --pwd /private/var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/p-it-antons-mac-ts-lb-simp-6b81ed54-1927854174 --query-mode false --parallel 2147483647 .
  502  4423  4217   0  2:46PM ttys002    0:00.00 grep 76892

Example

N/A

Output of pulumi about

v3.86.0.

Additional context

N/A

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

t0yv0 avatar Oct 23 '23 19:10 t0yv0

Do you have a theory about how this provider can be the cause of this, as opposed to a Core issue? Node providers are a supported scenario, so it's not wrong per se.

mikhailshilkov avatar Oct 26 '23 10:10 mikhailshilkov

This is going to be tricky without a solid repro. I've not worked with the internals here much yet.

There's two issues:

  • why is it spinning CPU, what is it doing
  • why does it not self-destruct after the connection to the engine is lost

For the second issue we may have failed to implement heartbeat self-destruct for Node (std feature of Go providers).

t0yv0 avatar Oct 26 '23 14:10 t0yv0