Bug 1098606 - Need to change Selector from singleton to singleton per process (QPID-5637)
Summary: Need to change Selector from singleton to singleton per process (QPID-5637)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid
Version: 2.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 2.5.1
: ---
Assignee: Ken Giusti
QA Contact: Frantisek Reznicek
URL:
Whiteboard:
Depends On:
Blocks: 1100442
TreeView+ depends on / blocked
 
Reported: 2014-05-16 16:12 UTC by Mike Cressman
Modified: 2015-11-16 01:16 UTC (History)
6 users (show)

Fixed In Version: python-qpid-0.18-11
Doc Type: Bug Fix
Doc Text:
Previously, the Selector class instantiated a single global instance of itself. If an application using the selector call forked, the parent and child processes shared the Selector's open file descriptors, which ultimately led to the broker connections failing. The fix changes the behavior of the Selector from singleton, to singleton per process. When the forked child process attempts to use the Selector, the process creates its own set of file descriptors separate to the parent process. The new behavior corrects the originally reported issue.
Clone Of:
: 1100442 (view as bug list)
Environment:
Last Closed: 2014-06-30 10:26:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to make Selector pid-aware (one Selector per process) (692 bytes, patch)
2014-05-16 16:12 UTC, Mike Cressman
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-5637 0 None None None Never
Red Hat Product Errata RHBA-2014:0803 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 2 update 2014-06-30 14:25:29 UTC

Description Mike Cressman 2014-05-16 16:12:04 UTC
Created attachment 896463 [details]
Patch to make Selector pid-aware (one Selector per process)

Description of problem:
The file descriptors registered by the Selector object inside of qpid.messaging are stale after a fork. The Selector object uses a singleton pattern to provide a reference to the same Selector object no matter how many times you call it. This selector object already has registered file descriptors with the filesystem, which allow the selector to read/write data in an I/O efficient manner.  Changing the singleton to keep a Selector per process would allow
each process to use it's own Selector (and associated resources).


Version-Release number of selected component (if applicable):
python-qpid-0.18-9

How reproducible:
100%

Steps to Reproduce:
See https://issues.apache.org/jira/browse/QPID-5637

Actual results:
After a fork, both processes share a Selector, causing problems.

Expected results:
Each process has its own Selector (and resources)


Additional info:

Comment 4 Ken Giusti 2014-05-20 18:14:04 UTC
Fixed on upstream trunk:
https://svn.apache.org/viewvc?view=revision&revision=r1596341

Comment 10 Frantisek Reznicek 2014-06-26 15:36:17 UTC
The issue has been fixed, python client is now able to connect to broker from main and forked process on all RHEL5.9 i/x / 6.4 i/x / 7.0 x:

python-qpid-0.18-12.el5_10
python-qpid-qmf-0.18-24.el5_10
qpid-cpp-client-0.18-25.el5_10
qpid-cpp-client-devel-0.18-25.el5_10
qpid-cpp-client-devel-docs-0.18-25.el5_10
qpid-cpp-client-rdma-0.18-25.el5_10
qpid-cpp-client-ssl-0.18-25.el5_10
qpid-cpp-mrg-debuginfo-0.18-25.el5_10
qpid-cpp-server-0.18-25.el5_10
qpid-cpp-server-cluster-0.18-25.el5_10
qpid-cpp-server-devel-0.18-25.el5_10
qpid-cpp-server-ha-0.18-25.el5_10
qpid-cpp-server-rdma-0.18-25.el5_10
qpid-cpp-server-ssl-0.18-25.el5_10
qpid-cpp-server-store-0.18-25.el5_10
qpid-cpp-server-xml-0.18-25.el5_10
qpid-java-client-0.18-8.el5_9
qpid-java-common-0.18-8.el5_9
qpid-java-example-0.18-8.el5_9
qpid-jca-0.18-8.el5
qpid-jca-xarecovery-0.18-8.el5
qpid-jca-zip-0.18-8.el5
qpid-qmf-0.18-24.el5_10
qpid-qmf-debuginfo-0.18-24.el5_10
qpid-qmf-devel-0.18-24.el5_10
qpid-tests-0.18-2.el5
qpid-tools-0.18-10.el5_9
rh-qpid-cpp-tests-0.18-25.el5_10
ruby-qpid-qmf-0.18-24.el5_10

python-qpid-0.18-12.el6.noarch
python-qpid-qmf-0.18-24.el6.i686
qpid-cpp-client-0.18-25.el6.i686
qpid-cpp-client-devel-0.18-25.el6.i686
qpid-cpp-client-devel-docs-0.18-25.el6.noarch
qpid-cpp-client-rdma-0.18-25.el6.i686
qpid-cpp-client-ssl-0.18-25.el6.i686
qpid-cpp-debuginfo-0.18-25.el6.i686
qpid-cpp-server-0.18-25.el6.i686
qpid-cpp-server-cluster-0.18-25.el6.i686
qpid-cpp-server-devel-0.18-25.el6.i686
qpid-cpp-server-ha-0.18-25.el6.i686
qpid-cpp-server-rdma-0.18-25.el6.i686
qpid-cpp-server-ssl-0.18-25.el6.i686
qpid-cpp-server-store-0.18-25.el6.i686
qpid-cpp-server-xml-0.18-25.el6.i686
qpid-java-client-0.18-8.el6_4.noarch
qpid-java-common-0.18-8.el6_4.noarch
qpid-java-example-0.18-8.el6_4.noarch
qpid-jca-0.18-8.el6.noarch
qpid-jca-xarecovery-0.18-8.el6.noarch
qpid-jca-zip-0.18-8.el6.noarch
qpid-qmf-0.18-24.el6.i686
qpid-qmf-debuginfo-0.18-24.el6.i686
qpid-qmf-devel-0.18-24.el6.i686
qpid-tests-0.18-2.el6.noarch
qpid-tools-0.18-10.el6_4.noarch
rh-qpid-cpp-tests-0.18-25.el6.i686
ruby-qpid-qmf-0.18-24.el6.i686


python-qpid-0.18-12.el7.noarch
python-qpid-qmf-0.18-24.el7.x86_64
qpid-cpp-client-0.18-25.el7.x86_64
qpid-cpp-client-devel-0.18-25.el7.x86_64
qpid-cpp-client-devel-docs-0.18-25.el7.noarch
qpid-cpp-client-rdma-0.18-25.el7.x86_64
qpid-cpp-client-ssl-0.18-25.el7.x86_64
qpid-cpp-debuginfo-0.18-25.el7.x86_64
qpid-cpp-server-0.18-25.el7.x86_64
qpid-cpp-server-cluster-0.18-25.el7.x86_64
qpid-cpp-server-devel-0.18-25.el7.x86_64
qpid-cpp-server-ha-0.18-25.el7.x86_64
qpid-cpp-server-rdma-0.18-25.el7.x86_64
qpid-cpp-server-ssl-0.18-25.el7.x86_64
qpid-cpp-server-store-0.18-25.el7.x86_64
qpid-qmf-0.18-24.el7.x86_64
qpid-qmf-debuginfo-0.18-24.el7.x86_64
qpid-qmf-devel-0.18-24.el7.x86_64
qpid-tools-0.18-10.el7.noarch
rh-qpid-cpp-tests-0.18-25.el7.x86_64

I created special reduced reproducer for RHEL 5/6/7, see it attached in bug 1113675 comment 1.

Reproducer is passing well on RHEL6/7, but on RHEL5 there is another linked problem in different part (while sending from both main and fork process) of the client tracked as bug 1113675.


-> VERIFIED

Comment 12 errata-xmlrpc 2014-06-30 10:26:35 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.

http://rhn.redhat.com/errata/RHBA-2014-0803.html


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