pcp
[Top] [All Lists]

Re: [pcp] PCP Updates: mgoodwin pmrep + qa

To: Marko Myllynen <myllynen@xxxxxxxxxx>, pcp@xxxxxxxxxxx
Subject: Re: [pcp] PCP Updates: mgoodwin pmrep + qa
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Thu, 11 Feb 2016 11:22:04 +1100
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <56BB0946.5040407@xxxxxxxxxx>
References: <56BA340C.1020300@xxxxxxxxxx> <56BB0946.5040407@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
On 02/10/2016 08:56 PM, Marko Myllynen wrote:
Hi,

On 2016-02-09 20:46, Dave Brolley wrote:
Changes committed to git://git.pcp.io/pcp.git master

Mark Goodwin (2):
       pmrep: cleanup stdio on exit to avoid Exception Ignored errors
       qa: add test 880 to check pmrep for broken pipe exceptions and
Exception Ignored errors

I'm still seeing issues after this patch, in fact now I have issues
also with Python 2:

$ python3 /tmp/pcp/bin/pmrep --archive $here/archives/20130706 -o csv -u -S 
@10:00 -x kernel.all.sysfork | head -n 1
#
zsh: broken pipe  python3 /tmp/pcp/bin/pmrep --archive $here/archives/20130706 
-o csv -u -S  -x |
zsh: done         head -n 1
$ python2 /tmp/pcp/bin/pmrep --archive $here/archives/20130706 -o csv -u -S 
@10:00 -x kernel.all.sysfork | head -n 1
#
zsh: broken pipe  python2 /tmp/pcp/bin/pmrep --archive $here/archives/20130706 
-o csv -u -S  -x |
zsh: done         head -n 1
$

This is on RHEL 7 (Python 2.7 and Python 3.3 in use). The reason why
I'm so inclined to have this fixed shows above, with PRINT_EXIT_VALUE
Zsh prints some ugly diagnostics.

Isn't zsh's PRINT_EXIT_VALUE doing just that here - printing that there was
a broken pipe for pmrep (for which the signal was ignored via SIG_DFL),
and that 'head' exited normally? I'll install zsh and test some more.


Does this work for everyone else or can this be a local hickup? I
already tried using SIG_IGN instead of SIG_DFL etc to no avail.

I'll check on rhel7 - I've only been testing on f23 with py2 and py3.
But basically - python installs a sigpipe handler to raise an exception
on broken pipe. We trapped this in pmiostat to ignore the socket.error
exception, but I think the better solution is to restore the SIGPIPE SIG_DFL
handler from glibc, which is what pmrep is now doing - this avoids the
python exception and ignores SIGPIPE by default. Not sure why SIG_IGN
didn't work though. Anyway - so I'll change pmiostat to SIG_DFL SIGPIPE
too unless anyone has a better idea?

Regards

<Prev in Thread] Current Thread [Next in Thread>