workers-sdk
workers-sdk copied to clipboard
Work out why `workerd` processes aren't shutdown
We need to identify the root cause of https://github.com/cloudflare/workers-sdk/issues/4612, fixed by https://github.com/cloudflare/workers-sdk/pull/4635
I'm experiencing the same. I added a kill command inside my package.json to get away from it for the time being - maybe it's helpful to others too.
"scripts": {
"serve": "wrangler dev src/index.ts || bun run kill",
"deploy": "wrangler deploy --minify src/index.ts",
"kill": "lsof -i :8787 | awk 'NR!=1 {print $2}' | xargs kill"
},
Some of our engineers and community members are still experiencing #4612 at times. The earliest version of workerd we even used was 1.20240129.0, so #4635 was already released. We’re now on 1.20240806.0.
We haven’t found a reproduction yet unfortunately—just that it happens likely after long or intense use—but I’ll report back once we do.
Our tracking issue is: https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues/2159
Update: I found reproduction steps for the lingering processes (but not >90% CPU usage or blocking ports, though it might be the same cause?). I opened https://github.com/cloudflare/workers-sdk/issues/6510 because it seems not necessarily related to workerd and moreso to the workerd process not being cleaned up by Wrangler or Miniflare on error.
In our case, stopping the service that uses wrangler during updates might be a workaround.