Bug 493016 - Race condition in closing session due to exception
Race condition in closing session due to exception
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
1.1
All Linux
urgent Severity medium
: 1.1.1
: ---
Assigned To: mick
ppecka
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-31 07:06 EDT by Gordon Sim
Modified: 2011-08-12 12:22 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-05 09:50:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test case (2.97 KB, text/x-c++src)
2009-04-09 06:17 EDT, Gordon Sim
no flags Details
patch for fix (656 bytes, patch)
2009-04-09 06:22 EDT, Gordon Sim
no flags Details | Diff

  None (edit)
Description Gordon Sim 2009-03-31 07:06:49 EDT
If a Session object goes out of scope, the ConnectionImpl will throw a FramingErrorException for any frames received on the correspodning channel. 

This is in itself incorrect as the broker may not have ever been sent a detach. However it only causes a real problem when a session is closed due to an exception. In this case the client receives an execution.exception command followed by a session.detach control. If the session goes out of scope between the processing of these two, the handling of the detach causes a FramingErrorException which causes the client to close the connection thus destroying all other active sessions.
Comment 1 Gordon Sim 2009-04-09 06:17:24 EDT
Created attachment 338884 [details]
test case

The attached test program creates several sessions on the same connection. Most of these are simply sending and receiving messages. One session periodically executes a command that will cause a SessionException.

Correct behaviour is for the test to end and report that all clients completed successfully (and the test returns 0).

The bug reported here results in exceptions of the following type:

Failed: framing-error: not-attached: Invalid channel: 32 (qpid/client/ConnectionImpl.cpp:115)

And the test then returns a non-zero value.
Comment 2 Gordon Sim 2009-04-09 06:19:15 EDT
Fixed as r762312 on qpids 0.5 branch and as r763163 on trunk.
Comment 3 Gordon Sim 2009-04-09 06:22:27 EDT
Created attachment 338885 [details]
patch for fix

This is the patch that fixes the above issue.
Comment 4 Gordon Sim 2009-04-17 13:56:31 EDT
Fixed in qpidc-0.5.752581-5.el5
Comment 5 Justin Ross 2011-06-28 15:22:06 EDT
Does this have test coverage?
Comment 6 ppecka 2011-07-01 20:11:40 EDT
Verified on rhel5.6 / rhel6.2 (i686/x86_64)

rpm -qa | grep qpid | sort -u
python-qpid-0.10-1.el5
python-qpid-qmf-0.10-10.el5
qpid-cpp-client-0.10-8.el5
qpid-cpp-client-devel-0.10-8.el5
qpid-cpp-client-devel-docs-0.10-8.el5
qpid-cpp-client-ssl-0.10-8.el5
qpid-cpp-server-0.10-8.el5
qpid-cpp-server-cluster-0.10-8.el5
qpid-cpp-server-devel-0.10-8.el5
qpid-cpp-server-ssl-0.10-8.el5
qpid-cpp-server-store-0.10-8.el5
qpid-cpp-server-xml-0.10-8.el5
qpid-java-client-0.10-6.el5
qpid-java-common-0.10-6.el5
qpid-java-example-0.10-6.el5
qpid-qmf-0.10-10.el5
qpid-qmf-devel-0.10-10.el5
qpid-tests-0.10-1.el5
qpid-tools-0.10-6.el5
rh-qpid-cpp-tests-0.10-8.el5

--> VERIFIED

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