Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32591
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.014 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'output': 0.04; 'parsing': 0.07; 'yet.': 0.13; 'library': 0.15; 'finished': 0.15; "hasn't": 0.15; 'cleaner': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:Avoiding': 0.16; 'wrote:': 0.17; 'detect': 0.17; 'header:In-Reply-To:1': 0.25; 'message- id:@mail.gmail.com': 0.27; 'parent': 0.29; 'fri,': 0.30; 'up.': 0.31; 'url:python': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'process,': 0.35; 'richard': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'child': 0.36; 'url:library': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'hello,': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'hoping': 0.72; 'defunct': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3CE3Kwo8Kd6j5mirf7TVHeG/PLEzbo7WkkwLyhcbyi8=; b=r5Iqh7OcNXT8bhMpmliDpq823myWAMJH65aLN7zrfjy8N2fldvdetUK2GwnTA2XiQp obUvF9P/djHW3CyU3aROzOmitigV0sSvnhg5VKmxMqJ20X5NxlP0EQ7rM53HvFZNxkz4 LcCC74DimUtX7shgCNdYI0407yFWalpU/rHXG6x7aH5JbUerHJq+1fHdtEfHS8Gb6tCk S25xxkklq6SgcuR/y5iRQEisa+JpUMsw8HFtQWCsdQvYqthsSwH6wLw12Nn1WmPwQDZs ne3SyvBQQFSE1X3Z2kJL2IIoS4jDPh1pM2iiKpRumxv9uzwgCq7ggs3b6XRAXiNc5GMO PkFA== |
| MIME-Version | 1.0 |
| In-Reply-To | <b8d1fb3a-20cd-4889-900a-61ec5b64f0c1@uc4g2000pbc.googlegroups.com> |
| References | <b8d1fb3a-20cd-4889-900a-61ec5b64f0c1@uc4g2000pbc.googlegroups.com> |
| Date | Fri, 2 Nov 2012 13:36:40 +1100 |
| Subject | Re: Avoiding defunct processes |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3175.1351823803.27098.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1351823803 news.xs4all.nl 6865 [2001:888:2000:d::a6]:52546 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:32591 |
Show key headers only | View raw
On Fri, Nov 2, 2012 at 1:16 PM, Richard <richardbp@gmail.com> wrote: > Hello, > > I create child processes with subprocess.Popen(). > Then I either wait for them to finish or kill them. > Either way these processes end up as defunct until the parent process > completes: > $ ps e > 6851 pts/5 Z+ 1:29 [python] <defunct> > > This confuses another library as to whether the processes are > complete. > For now I detect which processes are defunct by parsing the output of > "ps". > What would you recommend? I am hoping there is a cleaner way. That's a zombie process, it's finished but the parent hasn't wait()ed for it yet. http://docs.python.org/3.3/library/subprocess.html#subprocess.Popen.wait Once the process has ended, call that to get its return value and clean everything up. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Avoiding defunct processes Richard <richardbp@gmail.com> - 2012-11-01 19:16 -0700 Re: Avoiding defunct processes Chris Angelico <rosuav@gmail.com> - 2012-11-02 13:36 +1100 Re: Avoiding defunct processes Nobody <nobody@nowhere.com> - 2012-11-02 15:46 +0000
csiph-web