Skip to content

Loading…

Inconsistent behavior of uv_spawn in Unix and Windows #718

Closed
saghul opened this Issue · 0 comments

2 participants

@saghul
Joyent member

Hoi!

Here is a simple test written with pyuv:

import pyuv

loop = pyuv.Loop.default_loop()
proc = pyuv.Process(loop)
proc.spawn('some_existing_binary', lambda *a: None)
loop.run()

This test hangs forever on Unix but works just fine on Windows. Apparently the cause for this is that Windows will stop the handle after the child is done, while in Unix we need to call uv_close or it will remain active. I personally find the Windows approach to be the good one. Is this a known bug?

If it isn't, I can try to fix it, by stopping the handle right here: https://github.com/joyent/libuv/blob/master/src/unix/process.c#L91 and take care of removing the handle from the process handle queue properly.

Is there something obvious that would break with the above change?

@bnoordhuis bnoordhuis added a commit that closed this issue
@bnoordhuis bnoordhuis unix: auto-unref spawn handle on process exit
Consistent, for better or worse, with uv-win.

Fixes #718.
da0b84d
@saghul saghul referenced this issue in saghul/pyuv
Closed

Process spawn hangs forever (MacOS) #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.