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

wait() / communicate() can hang indefinitely with no recourse #74

Open
bcov77 opened this issue Jan 27, 2022 · 0 comments
Open

wait() / communicate() can hang indefinitely with no recourse #74

bcov77 opened this issue Jan 27, 2022 · 0 comments

Comments

@bcov77
Copy link

bcov77 commented Jan 27, 2022

The issue here is basically that there's no way to specify a timeout. I hacked the code myself with a new exception type, a global constant for timeout, and a few std::chrono calls in wait_for_child_exit(). However, my global constant probably isn't a great way to do this.

Why is this a problem?

Consider that you have a very important process which cannot crash or hang which needs to run a program that potentially behaves badly. If the other program does behave badly (monitored through pipes, i/o, etc), one would probably like to kill and print the stdout/stderr.

Now, presumably kill(9); communicate(); will always return quickly. But suppose it doesn't and your other program really is just deadlocked. Now your main program is going to hang and there's nothing you can do about it.

@bcov77 bcov77 changed the title wait() / communicate() hang indefinitely with no recourse wait() / communicate() can hang indefinitely with no recourse Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant