I have a customer that launched reg.exe with the /f switch and created a 
monster (it looks like reg.exe prompts for user input, reads stdin, sees 
the EOF and re-writes the prompt to stdout in a tight loop).

I've tried several different ways to stop the write and ended up with a 
wrapper writer with an interrupt channel and several sleep statements to 
allow the goroutines to yield long enough to notice cancel.  I'm curious if 
the community knows a better way to force these goroutines to yield so I 
can stop the process without introducing sleeps?

https://play.golang.org/p/kDHRQfgR3Y

The main process is PowerShell and it ends even though Reg continues to run 
- I'm not trying to solve that (It may not be ideal, but it is acceptable 
as long as we can prevent it from filling the disk with the stdout file).

This problem seems to be a combination of this: 
https://github.com/golang/go/issues/13155 (runaway child processes don't 
allow output to close, hanging command.wait) and the high frequency writes 
preventing the timeout signal from being recognized.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to