Skip to content


Inconsistent behavior of uv_spawn in Unix and Windows #718

saghul opened this Issue · 0 comments

2 participants

Joyent member


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)

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: 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.
@saghul saghul referenced this issue in saghul/pyuv

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.