Bug 452546 - No way to determine if session/connection is established
Summary: No way to determine if session/connection is established
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid
Version: 1.0
Hardware: All
OS: Linux
low
low
Target Milestone: 1.3
: ---
Assignee: Rafael H. Schloming
QA Contact: Frantisek Reznicek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-23 17:18 UTC by Robert Rati
Modified: 2015-11-16 00:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The Messaging Client Python API now provides the connection.opened, connection.closed, and session.closed API calls, for programmatically determining when connections or sessions are open or closed.
Clone Of:
Environment:
Last Closed: 2010-10-14 15:58:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0773 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise MRG Messaging and Grid Version 1.3 2010-10-14 15:56:44 UTC

Description Robert Rati 2008-06-23 17:18:44 UTC
Description of problem:
There isn't a public method to determine if a session or connection is open and
thus needs to be closed in a graceful shutdown.  This is needed/useful in
exception scenarios.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Frantisek Reznicek 2010-09-22 14:27:18 UTC
The feature was implemented to the python's low level API
  connection.opened
  connection.closed
and
  session.closed

tested on RHEL4.8 / 5.5 i386 / x86_64 on
python-qpid-0.7.946106-14.el4/5

All above properties are functional.

-> VERIFIED


P.S. Python's high level API contains:
  connection.opened
and
  session.closed



Additional info (testing approach):
[root@mrg-qe-03 ~]# python
Python 2.3.4 (#1, Jul 16 2009, 07:03:37)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import qpid;
>>> from qpid.connection import Connection;
>>> from qpid.util import connect
>>> from qpid.datatypes import Message, RangedSet, uuid4
>>>
>>> def conn_stat (c):
...   #print c;
...   print c.opened;
...   print c.closed;
...
>>> def sess_stat (s):
...   print s;
...   print s.closed;
...
>>> socket = None;
>>> socket = connect('localhost', 5672);
>>> connection = Connection(sock=socket);
>>> conn_stat(connection);
False
False
>>> connection.start();
>>> conn_stat(connection);
True
False
>>> session = connection.session(str(uuid4()));
>>> sess_stat(session);
<Session: 64f90f0a-f9cc-764a-8230-7d4d5e1d5ba5, 127.0.0.1:46735[1]>
<bound method Session.closed of <Session: 64f90f0a-f9cc-764a-8230-7d4d5e1d5ba5, 127.0.0.1:46735[1]>>
>>> session.close(timeout=10);
>>> sess_stat(session);
<Session: 64f90f0a-f9cc-764a-8230-7d4d5e1d5ba5, None>
<bound method Session.closed of <Session: 64f90f0a-f9cc-764a-8230-7d4d5e1d5ba5, None>>
>>> connection.close();
>>> conn_stat(connection);
False
True
>>>

Comment 3 Douglas Silas 2010-10-07 15:53:23 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The Messaging Client Python API now provides the connection.opened, connection.closed, and session.closed API calls, for programmatically determining when connections or sessions are open or closed.

Comment 5 errata-xmlrpc 2010-10-14 15:58:08 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/RHSA-2010-0773.html


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