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
|