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:
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 >>>
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.
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