r-lib/processx

Win10, long-lived processes - "system error 232, The pipe is being closed"

stupidpupil opened this issue · 5 comments

I'm using processx to run several long-lived (i.e. weeks or months) processes on Windows 10, including capturing their output.

After a while, child processes end up in a state where I don't seem to be able to kill them (from the main process), they don't seem to be able to produce output and I end up with the following errors in the main process output:

An error occurred when writing to the named pipe. (system error 232, The pipe is being closed.
) @win/named_pipe.c:135 (processx_write_named_pipe)>
in process

I may well be doing something wrong. Any thoughts?

Can you please show a reproducible example?

I will try; I'm struggling to reproduce it reliably myself, because of the dependence on waiting days or weeks to provoke it.

You can try to write the output into a file, then no pipe is needed, and this error should go away, or at least manifest in a different way.

Thanks, I'll try that as well when I manage to setup a proper testbed.

(I'm really sorry for the lack of reprex since I've posted this - I'm not ignoring that, I just have not had the chance to set things up!)

No worries at all, no rush at my end. It could also help if you could show some (possibly simplified) version of your code, even if it does not reproduce the problem for a long time.

I did some searching, and there is a very small chance that it is this:
https://stackoverflow.com/a/43070326/604364
I say very small, because I am pretty sure that processx handles reading no data from the pipe properly.

If I had to guess I would say that it is probably a race condition in processx, but some code could help me make a better guess.