Closed MisterDA closed 1 year ago
I wish I had found this earlier.
Unfortunately this doesn't work on Windows, because Unix.set_nonblock
doesn't work on Windows.
I would suggest that we revert back to the previous implementation.
Maybe I just went too far and we can do blocking IO instead? Sorry about the problems this caused you, I forgot about Windows not supporting non-blocking IO on pipes.
BTW, won't this change make debugging hangs harder? Normally if my MDX code hangs I look in /tmp to see the output so far - does this no longer work on 2.2?
(though I'd be happy with a better solution)
Merged #414 to revert to the previous behaviour until we find a better solution. Will be part of 2.2.1.
While debugging a problem with mdx, I've taken the liberty of rewriting the redirect code with pipes (instead of a temporary file, a tmpfs on Unix buf there's no tmpfs on Windows), and using non-blocking reads instead of
lseek
aslseek
isn't available on pipes. I've also protected file descriptors with close-on-exec.I think the code is correct, but I'd be delighted if there's a bigger example on which to assert everything's fine.