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

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

Open
stupidpupil opened this issue Sep 5, 2022 · 5 comments
Labels
reprex needs a minimal reproducible example

Comments

@stupidpupil
Copy link

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?

@gaborcsardi
Copy link
Member

Can you please show a reproducible example?

@stupidpupil
Copy link
Author

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

@gaborcsardi
Copy link
Member

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.

@gaborcsardi gaborcsardi added the reprex needs a minimal reproducible example label Oct 18, 2022
@stupidpupil
Copy link
Author

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!)

@gaborcsardi
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants