Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'output': 0.05; 'error:': 0.07; 'python3': 0.07; 'idea?': 0.09; 'line:': 0.09; 'ping': 0.09; 'python': 0.11; '1:09': 0.16; 'command.': 0.16; 'timeout': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'pieces': 0.19; 'subject:lost': 0.19; 'code,': 0.22; 'aug': 0.22; 'bytes': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'thanks!': 0.32; 'run': 0.32; 'bugs': 0.33; 'noticed': 0.34; 'could': 0.34; 'problem': 0.35; 'created': 0.35; 'received:google.com': 0.35; 'replies': 0.36; 'possible': 0.36; 'two': 0.37; 'tasks': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'skip:z 20': 0.60; 'introduced': 0.61; 'new': 0.61; 'traffic': 0.61; "you're": 0.61; 'first': 0.61; 'increasing': 0.74; 'missing.': 0.84; 'task,': 0.91; 'examine': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=locationd.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4E7GXJkHWsJWEA5AKTAEf/iVDEMAdA7DpPaitsUcXAw=; b=K0SWdhZSKd5Q1Dib3sIBi4xWZfs2Vi86YdKGoj4mfwXFt0c304ju0DeFmpM372PJJO U7lQH1mp1moiIzfo1WYFMotmswxUnEIsISZC8jy3W6VblT3upyOC4Hcc/LUm3f2bXubZ BUfAkFd2lEv72gMynpNguXFZ6qs4MpWaSQc7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=4E7GXJkHWsJWEA5AKTAEf/iVDEMAdA7DpPaitsUcXAw=; b=G+VEH36DdR28bdAzNhgWtQVbuzx3gT/Amm9oGX5AErRS0uICFa3IoyAbImEFyHAzpE g61Alwwu6VDmAW0lj4SWMcdYZ2XaYh45wvdplrM8+U5rFjvoGEAcN3rs8qHhk7BPp14c bzBzzC1SRFDWJbkd4erV5kzVU+H4dMflJyyGnXFHsSbl1f7s50e6uFYUoH5fwgxOweZo up4mWVp+LmxthaiTLzL57KMY144IXnt/DZ6QEfmV9wO1+emVbkyTjvU7CtAEVdMCM057 TElSp2GnOzhOjTat9qhglaf3ZdBNUEd2jwoaMmYd4hxElx+fECb1EN68MD+hO96MJ4bn kQgw== X-Gm-Message-State: ALoCoQlzOTtXalqprFMHOainBxgk/KB2co9otrrSWkD3f28fKRwJNtyzASdm1VlvTs2Jt4wXgbv0 MIME-Version: 1.0 X-Received: by 10.194.71.11 with SMTP id q11mr50328869wju.33.1408468097944; Tue, 19 Aug 2014 10:08:17 -0700 (PDT) X-Originating-IP: [117.195.83.176] In-Reply-To: <545114fa-ef61-487e-a707-ddcc9e94bcb9@googlegroups.com> References: <545114fa-ef61-487e-a707-ddcc9e94bcb9@googlegroups.com> Date: Tue, 19 Aug 2014 22:38:17 +0530 Subject: Re: asyncio subprocess PIPE output lost From: Kushal Kumaran To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Tue, 19 Aug 2014 20:39:18 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408473559 news.xs4all.nl 2934 [2001:888:2000:d::a6]:41864 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76593 On Tue, Aug 19, 2014 at 1:09 PM, yuzhichang wrote: > Hi all, > I'm new to asyncio introduced by Python 3.4. I created two tasks each pings a host. I noticed some pieces of output will be lost(see "error: found icmp_seq gap"). If I changed to run only one task, this problem never occur. > Do you have any idea? > Thanks! > Zhichang > > zhichyu@cto-team-6:~$ python3 asyn2.py > got line: b'PING tyr.global.tektronix.net (10.250.163.252) 56(84) bytes of data.\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=2 ttl=55 time=204 ms\n' > got line: b'PING babylon.rich.tek.com (10.250.155.123) 56(84) bytes of data.\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=2 ttl=55 time=205 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=3 ttl=55 time=205 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=3 ttl=55 time=205 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=4 ttl=55 time=196 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=4 ttl=55 time=198 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=5 ttl=55 time=181 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=5 ttl=55 time=182 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=6 ttl=55 time=180 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=6 ttl=55 time=179 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=7 ttl=55 time=193 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=7 ttl=55 time=196 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=8 ttl=55 time=185 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=8 ttl=55 time=187 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=9 ttl=55 time=213 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=9 ttl=55 time=211 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=10 ttl=55 time=192 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=10 ttl=55 time=192 ms\n' > got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=11 ttl=55 time=210 ms\n' > got line: b'64 bytes from babylon.rich.tek.com (10.250.155.123): icmp_seq=12 ttl=55 time=210 ms\n' > error: found icmp_seq gap! > > Before looking for possible bugs in your code, the first thing to check would be if you are actually missing ping replies, rather than output from the ping command. Try increasing the timeout (-W) for the ping command. If you're familiar with tools like tcpdump and wireshark, you could use those to examine the network traffic and see if replies are missing. -- regards, kushal