Bug 518603

Summary: Closing a connection via management command does not release sessions
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: high Docs Contact:
Priority: urgent    
Version: 1.1.6CC: esammons, freznice, iboverma, lbrindle, mcressma, tross
Target Milestone: 1.2   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Messaging bug fix C: If a connection is closed using a management method such as qpid-tool the sessions appear not to be freed correctly. C: The sessio names remain locked from further use, and the client gets a 'session-busy' exception. F: Connections now close themselves when the management method (i.e. from qpid-tool) is closing. R: The session is now released correctly, and can be re-attached with the same session name If a connection was closed using a management method such as qpid-tool, the session names were remaining locked from further use, and the client received a 'session-busy' exception. Connections now close themselves when the management method is closing and the session can be re-attached with the same name.
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-03 09:17:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 527551    
Attachments:
Description Flags
example of application using specfic session name none

Description Gordon Sim 2009-08-21 08:29:21 UTC
Created attachment 358206 [details]
example of application using specfic session name

Description of problem:

If a connection is closed using the management method (e.g. via qpid-tool), the sessions appear not to be freed up and the names remain locked from further use.

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

qpidd-0.5.752581-26.el5

How reproducible:


Steps to Reproduce:
1. start broker
2. start session using a specific session name (e.g. use attached test case, in which case also create a queue called test-queue)
3. start qpid-tool, list sessions, show session with specific name used in 2. and then close the connection ('call <ID> close' where ID is the value listed as the connectionRef for the session)
4. the application in 2. should now have been notified of the closed connection; try to restart it (using the same session name)
  
Actual results:

Client gets a 'session-busy' exception. Broker contains log messages like:

2009-aug-21 03:51:31 error Channel exception: session-busy: Session already attached: anonymous.my-session (qpid/broker/SessionManager.cpp:55)


Expected results:

Able to re-attach with the same session name

Additional info:

Comment 1 Gordon Sim 2009-09-01 15:25:31 UTC
Fixed on trunk by r810094 (http://svn.apache.org/viewvc?rev=810094&view=rev)

Comment 4 Frantisek Reznicek 2009-10-22 16:47:53 UTC
There is difficulty with qpid-tool's 'call <ID> close', because it says 
'Call Result: close 3 (NotImplemented) {}' and gives up.

Is there any other way how to force closing session?


Thanks upfront for the response.


Transcript:
qpid: schema
Classes in Schema:
    Class                              Properties  Statistics  Methods
    ====================================================================
    com.redhat.rhm.store:journal       14          30          1
    com.redhat.rhm.store:store         12          10          0
    org.apache.qpid.broker:agent       7           1           0
    org.apache.qpid.broker:binding     6           2           0
    org.apache.qpid.broker:bridge      13          1           1
    org.apache.qpid.broker:broker      10          2           3
    org.apache.qpid.broker:connection  10          6           1
    org.apache.qpid.broker:exchange    6           13          0
    org.apache.qpid.broker:link        6           3           2
    org.apache.qpid.broker:queue       7           28          1
    org.apache.qpid.broker:session     9           7           4
    org.apache.qpid.broker:system      7           1           0
    org.apache.qpid.broker:vhost       4           1           0
qpid: list org.apache.qpid.broker:session
Objects of type org.apache.qpid.broker:session
    ID   Created   Destroyed  Index
    ======================================================================
    123  13:44:21  -          103.my-session
    124  15:14:56  -          103.mrg-qe-02.lab.eng.brq.redhat.com.21092
qpid: call 123 close
qpid: Call Result: close  3 (NotImplemented) {}

Comment 5 Irina Boverman 2009-10-22 17:41:58 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
Closing a connection via management command (e.g. qpid-tool) is now working correctly, it releases session and allows to re-attach with the
same session name (518603)

Comment 6 Frantisek Reznicek 2009-10-23 13:46:06 UTC
The issue has been fixed, validated on RHEL 4.8 / 5.4 i386 / x86_64 on packages:
[root@mrg-qe-01 bz518603]# rpm -qa | egrep '(qpid|rhm)' | sort -u
python-qpid-0.5.752581-4.el5
qpid*-0.5.752581-30.el5
qpid-dotnet-0.4.738274-2.el5
qpid-java-client-0.5.751061-9.el5
qpid-java-common-0.5.751061-9.el5
rhm-0.5.3206-17.el5
rhm-docs-0.5.756148-1.el5

-> VERIFIED

Comment 7 Lana Brindley 2009-11-26 21:23:15 UTC
Release note updated. If any revisions are required, please set the 
"requires_release_notes"  flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

Diffed Contents:
@@ -1,2 +1,8 @@
-Closing a connection via management command (e.g. qpid-tool) is now working correctly, it releases session and allows to re-attach with the
+Messaging bug fix
-same session name (518603)+
+C: If a connection is closed using a management method such as qpid-tool the sessions appear not to be freed correctly.
+C: The sessio names remain locked from further use, and the client gets a 'session-busy' exception.
+F:
+R: The session is now released correctly, and can be re-attached with the same session name
+
+MORE INFO REQUIRED FOR RELNOTE

Comment 9 Lana Brindley 2009-12-01 23:39:27 UTC
Release note updated. If any revisions are required, please set the 
"requires_release_notes"  flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

Diffed Contents:
@@ -2,7 +2,7 @@
 
 C: If a connection is closed using a management method such as qpid-tool the sessions appear not to be freed correctly.
 C: The sessio names remain locked from further use, and the client gets a 'session-busy' exception.
-F:
+F: Connections now close themselves when the management method (i.e. from qpid-tool) is closing.
 R: The session is now released correctly, and can be re-attached with the same session name
 
-MORE INFO REQUIRED FOR RELNOTE+If a connection was closed using a management method such as qpid-tool, the session names were remaining locked from further use, and the client received a 'session-busy' exception. Connections now close themselves when the management method is closing and the session can be re-attached with the same name.

Comment 10 errata-xmlrpc 2009-12-03 09:17:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1633.html