Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76633

Re: asyncio subprocess PIPE output lost

Newsgroups comp.lang.python
Date 2014-08-19 21:04 -0700
References <545114fa-ef61-487e-a707-ddcc9e94bcb9@googlegroups.com> <mailman.13159.1408473559.18130.python-list@python.org>
Message-ID <7326e896-fba6-4530-bf37-b4dfda08c222@googlegroups.com> (permalink)
Subject Re: asyncio subprocess PIPE output lost
From yuzhichang <yuzhichang@gmail.com>

Show all headers | View raw


On Wednesday, August 20, 2014 1:08:17 AM UTC+8, Kushal Kumaran wrote:
> On Tue, Aug 19, 2014 at 1:09 PM, yuzhichang <yuzhichang@gmail.com> 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!
> 
> >
> 
> > <snipped code>
> 
> 
> 
> 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


Hi kushal,
    Wireshark shows some replies are missing. Changing destinations to localhost in code also fix the "icmp_seq gap" error. I should be more careful on debug these things.
    Thanks for your help!
Zhichang
   

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

asyncio subprocess PIPE output lost yuzhichang <yuzhichang@gmail.com> - 2014-08-19 00:39 -0700
  Re: asyncio subprocess PIPE output lost Kushal Kumaran <kushal@locationd.net> - 2014-08-19 22:38 +0530
    Re: asyncio subprocess PIPE output lost yuzhichang <yuzhichang@gmail.com> - 2014-08-19 21:04 -0700
      Re: asyncio subprocess PIPE output lost Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-20 10:00 +0100

csiph-web