[asterisk-dev] [Code Review] 3258: testsuite: eliminate sipp zombie
Scott Griepentrog
reviewboard at asterisk.org
Mon Feb 24 14:36:27 CST 2014
> On Feb. 24, 2014, 1:42 p.m., wdoekes wrote:
> > /asterisk/trunk/lib/python/asterisk/sippversion.py, lines 43-50
> > <https://reviewboard.asterisk.org/r/3258/diff/1/?file=54418#file54418line43>
> >
> > The problem you mentioned would only occur when both stdout and stderr have their own pipe.
> >
> > Like this:
> >
> > >>> x = Popen('(seq 100000 >&2; seq 10)', shell=True, stdout=PIPE, stderr=PIPE)
> > >>> for y in x.stdout:
> > ... print y
> > ...
> > (infinite wait)
> >
> > In the above case, stderr is redirected to stdout, so that problem doesn't occur.
> >
> > However, the process is never reaped.
> >
> > An:
> >
> > sipp_process.wait()
> >
> > should take care of that.
Confirmed. The addition of sipp_process.wait() after the for line... loop also corrects the problem.
- Scott
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3258/#review10934
-----------------------------------------------------------
On Feb. 24, 2014, 11:55 a.m., Scott Griepentrog wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3258/
> -----------------------------------------------------------
>
> (Updated Feb. 24, 2014, 11:55 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: testsuite
>
>
> Description
> -------
>
> While running the testsuite I noticed it would occasionally fail to start, complaining of being unable to kill sipp (code introduced svn r4677 and https://reviewboard.asterisk.org/r/3198/). I tracked this back to an instance of sipp that was used to check the version number, and revised the method used to read the stdout per python manual "Warning Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process.". The version check process was then cleanly terminated before checking for sipp instances leftover from a previous test run via pidof sipp.
>
> NOTE: other instances where popen.stdout is used may exist in the testsuite that could be causing similar random issues.
>
>
> Diffs
> -----
>
> /asterisk/trunk/lib/python/asterisk/sippversion.py 4735
>
> Diff: https://reviewboard.asterisk.org/r/3258/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Scott Griepentrog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140224/230f66f5/attachment.html>
More information about the asterisk-dev
mailing list