Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 is broken because childprocess.unref() fails #16784

Closed
khrj opened this issue Nov 24, 2022 · 5 comments
Closed

pm2 is broken because childprocess.unref() fails #16784

khrj opened this issue Nov 24, 2022 · 5 comments
Labels
bug Something isn't working node compat

Comments

@khrj
Copy link
Contributor

khrj commented Nov 24, 2022

image

When running with:

pm2 seems to fail because child.unref() failed internally

@khrj
Copy link
Contributor Author

khrj commented Nov 24, 2022

Note that this is only reproduced when running pm2 for the first time after startup (when it shows [PM2] Spawning PM2 daemon with pm2_home). After that, you need to deno run --unstable -A npm:pm2 kill to reproduce it again

@khrj
Copy link
Contributor Author

khrj commented Nov 24, 2022

Possibly related missing implementation:

import { createRequire } from "https://deno.land/std@0.165.0/node/module.ts"
const require = createRequire(import.meta.url)

const child_process = require("child_process")
const fs = require("fs")

const pipe = fs.openSync("/tmp/issue.log", 'a')

const child = child_process.spawn("echo", {
	stdio      : ['ipc', pipe, pipe]
})

image

@dsherret dsherret added bug Something isn't working node compat labels Nov 28, 2022
@bartlomieju
Copy link
Member

Unrefing child process is definitely implemented (eg. Vite uses it), but the problem seems to be usage of ipc as stdio.

@littledivy
Copy link
Member

child_process IPC is now implemented. See #21490

@bartlomieju
Copy link
Member

This issue should be resolved as of Deno v1.39.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node compat
Projects
None yet
Development

No branches or pull requests

4 participants