aws / jsii

jsii allows code in any language to naturally interact with JavaScript classes. It is the technology that enables the AWS Cloud Development Kit to deliver polyglot libraries from a single codebase!
https://aws.github.io/jsii
Apache License 2.0
2.62k stars 244 forks source link

nodejs process keeps running after cdk command exits #4604

Open trondhindenes opened 1 month ago

trondhindenes commented 1 month ago

Describe the bug

when running a cdk command such as "cdk ls", I can see two nodejs process starting:

node /usr/bin/cdk ls
node --max-old-space-size=4069 /tmp/tmpl2de_imf/bin/jsii-runtime.js

When the cdk command exits, the last of these is still running. This process has significant cpu usage, and should not be left "unmanaged". It looks like everytime I run a new cdk command, one more of these processes are spawned and not cleaned up, ultimately leading to system crash on my computer

Expected Behavior

all cdk-related nodejs processes should exit after the cdk command completes

Current Behavior

a rogue nodejs process is left behind.

Reproduction Steps

Hard to say. This certainly doesn't happen on all of our cdk apps, but it is consistent on one of them, which is a fairly large cdk app with lots of resources and sub-stacks

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.151.0 (build b8289e2)

Framework Version

No response

Node.js Version

v20.13.1

OS

Ubuntu 24

Language

Python

Language Version

Python 3.11

Other information

No response

pahud commented 1 month ago

Hard to say. This certainly doesn't happen on all of our cdk apps, but it is consistent on one of them, which is a fairly large cdk app with lots of resources and sub-stacks

I can't reproduce this in my CDK in Python app but this is probably due to the size of my CDK app.

I will bring this up to the team for inputs.

trondhindenes commented 2 weeks ago

thanks! I can try and slowly add complexity to an example cdk app to see if I can determine when it happens.