Bug 452546 - No way to determine if session/connection is established
No way to determine if session/connection is established
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid (Show other bugs)
1.0
All Linux
low Severity low
: 1.3
: ---
Assigned To: Rafael H. Schloming
Frantisek Reznicek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-23 13:18 EDT by Robert Rati
Modified: 2015-11-15 19:05 EST (History)
3 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-14 11:58:08 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)

  None (edit)
Description Robert Rati 2008-06-23 13:18:44 EDT
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 10:27:18 EDT
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 11:53:23 EDT
    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 11:58:08 EDT
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.