From: Michael Malone Date: 2009-03-17T05:00:04+09:00 Subject: Re: does IO.read block? > One problem that could hit you is that you might not get the > concurrency right: you need to make sure that stderr and stdout are > read concurrently (if there can be output on both) because if the pipe > on one of them fills up your child process is blocked. Maybe your > issue lies in that area. > I have set STDOUT.sync = true Is that enough? It should be, because I don't have any output originating from the child processes or any child threads, only the parent/calling thread. But I've been wrong before... Though I think I have narrowed the problem _very_ slightly. The thread/process pair that blocks indefinitely blocks on the read_end.read() call. Which is weird and annoying. My next task will be to set up some logging to figure out if there should have been an exception to chuck down the pipe. (In my test case I have a random amount of jobs, in which every second one raises an exception) Thanks a lot for your help! It's certainly possible that this is going to be my "Stupidly Difficult Bug When I Was Near The Beginning Of My First Programming Job" that everyone seems to have. Michael ======================================================================= This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission. =======================================================================