Bug 1187636 - Session detach is not detected by the client application
Summary: Session detach is not detected by the client application
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 3.1
: ---
Assignee: Gordon Sim
QA Contact: Petr Matousek
URL:
Whiteboard:
Depends On: 1093019
Blocks: 1094177
TreeView+ depends on / blocked
 
Reported: 2015-01-30 14:23 UTC by Petr Matousek
Modified: 2015-04-14 13:48 UTC (History)
6 users (show)

Fixed In Version: qpid-cpp-0.30-7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1093019
Environment:
Last Closed: 2015-04-14 13:48:57 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Apache JIRA QPID-6358 None None None Never
Red Hat Product Errata RHEA-2015:0805 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.1 Release 2015-04-14 17:45:54 UTC

Description Petr Matousek 2015-01-30 14:23:15 UTC
+++ This bug was initially created as a clone of Bug #1093019 +++

Description of problem:

The session detach is not detected by the client application. An exception shall be thrown when the session is detached by peer. The application is naturally not able to send/receive messages after the session was detached. 

Version-Release number of selected component (if applicable):
qpid-cpp-*-0.22-38

How reproducible:
100%

Steps to Reproduce:
1. drain -f amq.direct
2. detach the session used by the drain (ie. using qpid-tool)
   qpid-tool> call <session_id> detach
3. the drain program does not exit, but it's unable to receive messages anymore

Actual results:
The session detach is not detected.

Expected results:
The drain program exits with an exception ie: 'not-attached/Session ended by peer'

Additional info:

# ./drain -f amq.direct
# ./spout amq.direct
Message(properties={u'spout-id': u'0e97cb4e-8230-446c-a5c5-b48790e98fab:0'}, content_type=u'text/plain')
<OK - message received by the drain application>

# qpid-tool
Management Tool for QPID
qpid: list session
Object Summary:
    ID   Created   Destroyed  Index
    =========================================================================
    134  12:24:08  -          145.97aa9eaf-14dc-4f13-97e5-74d8f571765d:0
    135  12:25:57  -          145.dhcp-lab-110.englab.brq.redhat.com.3780.1
qpid: call 134 detach
qpid: OK (0) - {}
qpid: quit
Exiting...

<the drain program is still running>

# ./spout amq.direct
<Message not received by the drain application>

---

C++ 0-10 client:

# drain -f amq.direct
Error: not-attached: Session anonymous.3c8acd3b-9f55-4fa0-b89c-862df621361a isn't attached (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/client/SessionImpl.cpp:673)
terminate called after throwing an instance of 'qpid::messaging::MessagingException'

C++ 1.0 client:

# ./drain -f --connection-options "{protocol:'amqp1.0'}" amq.direct
Error: Session ended by peer

Comment 1 Petr Matousek 2015-01-30 14:32:04 UTC
For Qpid C++ amqp0-10 client:
There was a MessagingException thrown on previous releases after the session was detached. Currently the MessagingException is not thrown anymore and the client behaves like the Qpid Python client (no exception/unresponsive, please see above). So, this is a regression.

There is no change in amqp1.0 path (detaching session still leads to Error: Session ended by peer)

Comment 2 Gordon Sim 2015-02-03 21:52:09 UTC
Fixed upstream by https://svn.apache.org/r1656928

Comment 3 Gordon Sim 2015-02-04 17:47:39 UTC
(In reply to Gordon Sim from comment #2)
> Fixed upstream by https://svn.apache.org/r1656928

An intermittent issue with this fix was discovered in a particular case. A new approach has been taken in:

https://svn.apache.org/r1657321

Comment 5 Petr Matousek 2015-02-27 15:06:54 UTC
Affected packages:
qpid-cpp-*-0.30-6

Comment 7 Petr Matousek 2015-03-12 14:42:44 UTC
This issue has been fixed. Proper exception is reported (not-attached).
Verified on rhel6.6 (i686, x86_64) and rhel7.1 (x86_64).

Packages:
qpid-cpp-*-0.30-7

-> VERIFIED

Comment 9 errata-xmlrpc 2015-04-14 13:48:57 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/RHEA-2015-0805.html


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