Bugs item #1753891, was opened at 2007-07-14 03:06 Message generated for change (Settings changed) made by gbrandl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1753891&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Threads Group: Python 2.4 >Status: Closed Resolution: Duplicate Priority: 5 Private: No Submitted By: slowfood (slowfood) Assigned to: Nobody/Anonymous (nobody) Summary: subprocess raising "No Child Process" OSError Initial Comment: The program below demostrates a "No Child Process" OSError on a multi-cpu systems. This is extracted from a large system where we are trying to manage many sub-processes, some of which end up having little/no real work to do so they return very fast, here emulated by having the sub-process be an invocation of: Executable="/bin/sleep 0" Seems like some race condition, since if you make the child process take some time (sleep 0.1) the frequency of errors decreeses. Error only shows up when there are more threads than have real CPU's by at least a factor of two, on dual core machines up NumThreads to 18 to get the failures. Same error on both Python 2.4.3 with: Linux 2.6.18-gentoo-r3 Gentoo and Python 2.4.4 with: Linux 2.6.20-gentoo-r8 Any help appreciated - = = = ===== Start code example =========== % python subprocess_noChildErr.py Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap self.run() File "testCaseA.py", line 14, in run subprocess.call(Executable.split()) File "/usr/lib64/python2.4/subprocess.py", line 413, in call return Popen(*args, **kwargs).wait() File "/usr/lib64/python2.4/subprocess.py", line 1007, in wait pid, sts = os.waitpid(self.pid, 0) OSError: [Errno 10] No child processes Test finished % cat subprocess_noChildErr.py import subprocess, threading # Params Executable="/bin/sleep 0" NumThreads = 18 NumIterations = 10 class TestClass(threading.Thread): def __init__(self, threadNum): self.threadNum = threadNum threading.Thread.__init__(self) def run(self): for i in range(NumIterations): subprocess.call(Executable.split()) def test(): allThreads = [] for i in range(NumThreads): allThreads.append(TestClass(i)) for i in range(NumThreads): allThreads[i].start() for i in range(NumThreads): allThreads[i].join() print "Test finished" if __name__ == '__main__': test() % python -V Python 2.4.4 % uname -a Linux 2.6.20-gentoo-r8 #2 SMP PREEMPT Sun Jul 1 13:22:56 PDT 2007 x86_64 Dual-Core AMD Opteron(tm) Processor 2212 AuthenticAMD GNU/Linux % % date Fri Jul 13 19:26:44 PDT 2007 % = = = ===== End code example =========== ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2007-08-04 07:25 Message: Logged In: YES user_id=849994 Originator: NO Closing too. Tying bugs is not supported by SF. ---------------------------------------------------------------------- Comment By: slowfood (slowfood) Date: 2007-08-03 20:07 Message: Logged In: YES user_id=1844537 Originator: YES Managed to mark it as a duplicate, but not able to tie it to 1731717. Sorry - ;;slowfood ---------------------------------------------------------------------- Comment By: slowfood (slowfood) Date: 2007-08-03 20:01 Message: Logged In: YES user_id=1844537 Originator: YES I agree with abo that this looks to be a dup of 1731717, will try to mark it as such. ---------------------------------------------------------------------- Comment By: Donovan Baarda (abo) Date: 2007-08-03 19:37 Message: Logged In: YES user_id=10273 Originator: NO Bugs 1754642 and 1753891 both look like duplicates of bug 1731717 to me. I suggest marking them both as dups of 1731717 because that one has info on the race-condition that causes this and discussions on how to fix it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1753891&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com