Bug 1125954 - Piping ccs --getschema results in IOError: [Errno 32] Broken pipe
Summary: Piping ccs --getschema results in IOError: [Errno 32] Broken pipe
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ricci
Version: 6.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Chris Feist
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-01 12:44 UTC by Radek Steiger
Modified: 2015-07-22 07:33 UTC (History)
2 users (show)

Fixed In Version: ccs-0.16.2-77.el6.x86_64
Doc Type: Bug Fix
Doc Text:
Cause: ccs does not properly ignore SIGPIPE Consequence: When piping the output of ccs into another program a traceback can occur if the other program closes the pipe before ccs finishes. Fix: ccs now properly ignores the SIGPIPE signal Result: ccs no longer issues a traceback when piping its output to other programs which close the pipe before ccs finishes.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:33:50 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1405 normal SHIPPED_LIVE ricci bug fix and enhancement update 2015-07-20 18:07:08 UTC

Description Radek Steiger 2014-08-01 12:44:59 UTC
Description of problem:

Piping ccs --getschema into something, that doesn't wait for the whole output (like /usr/bin/head) results in broken pipe:

[root@virt-102 sbin]# ccs --getschema -h localhost | head -n1
<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_namespace">
Traceback (most recent call last):
  File "/usr/sbin/ccs", line 2450, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/ccs", line 334, in main
    if (getclusterschema): get_cluster_schema()
  File "/usr/sbin/ccs", line 859, in get_cluster_schema
    print out
IOError: [Errno 32] Broken pipe


Version-Release number of selected component (if applicable):

ccs-0.16.2-69.el6.x86_64
ccs-0.16.2-75.el6.x86_64

How reproducible:
Always


Steps to Reproduce:
1. ccs --getschema -h localhost | head
2.
3.

Comment 2 Chris Feist 2014-08-05 21:18:51 UTC
This is a common problem for most python programs because it doesn't ignore SIGPIPE (like most programs do).

Fix upstream here:
https://github.com/feist/ccs/commit/c3ce0a072f29ac82e7f9aeb54adb198c943fd976

Comment 3 Chris Feist 2015-03-03 23:21:06 UTC
Before Fix:

[root@ask-03 ~]# rpm -q ccs
ccs-0.16.2-75.el6.x86_64
[root@ask-03 ~]# ccs -h localhost --getschema | head -n0
Traceback (most recent call last):
  File "/usr/sbin/ccs", line 2450, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/ccs", line 334, in main
    if (getclusterschema): get_cluster_schema()
  File "/usr/sbin/ccs", line 859, in get_cluster_schema
    print out
IOError: [Errno 32] Broken pipe

After Fix:

[root@ask-02 ~]# rpm -q ccs
ccs-0.16.2-77.el6.x86_64
[root@ask-02 ~]# ccs -h localhost --getschema | head -n0
[root@ask-02 ~]#

Comment 6 errata-xmlrpc 2015-07-22 07:33:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1405.html


Note You need to log in before you can comment on or make changes to this bug.