Red Hat Bugzilla – Bug 493016
Race condition in closing session due to exception
Last modified: 2011-08-12 12:22:16 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.
Created attachment 338884 [details]
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.
Fixed as r762312 on qpids 0.5 branch and as r763163 on trunk.
Created attachment 338885 [details]
patch for fix
This is the patch that fixes the above issue.
Fixed in qpidc-0.5.752581-5.el5
Does this have test coverage?
Verified on rhel5.6 / rhel6.2 (i686/x86_64)
rpm -qa | grep qpid | sort -u