Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 908224 - reconnect_timeout ignored in qpid.messaging.Connection()
reconnect_timeout ignored in qpid.messaging.Connection()
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid (Show other bugs)
2.3
Unspecified Unspecified
medium Severity medium
: 3.0
: ---
Assigned To: Ernie
mick
: Patch
: 735080 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-06 03:23 EST by Tomas Rusnak
Modified: 2014-09-24 11:06 EDT (History)
5 users (show)

See Also:
Fixed In Version: python-qpid-0.22-3.el6, python-qpid-0.22-2.el5
Doc Type: Bug Fix
Doc Text:
It was discovered that the `reconnect_timeout` argument was ignored when creating a connection. Passing a `reconnect_timeout` when creating a connection did not raise an exception after the specified number of seconds. The fix passes the `reconnect_timeout` to the `open()` method, which allows an attempt to create a connection to timeout correctly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-24 11:06:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Uses reconnect and reconnect_timeout if supplied (1.10 KB, patch)
2013-03-07 14:29 EST, Ernie
no flags Details | Diff
Updated patch for reconnect and reconnect_timeout (1.81 KB, patch)
2013-04-24 17:11 EDT, Ernie
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-4774 None None None Never
Red Hat Product Errata RHEA-2014:1296 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 15:00:06 EDT

  None (edit)
Description Tomas Rusnak 2013-02-06 03:23:09 EST
Description of problem:
Calling Connection('localhost',reconnect_timeout=10) will not raise exception after 10 seconds.

Version-Release number of selected component (if applicable):
python-qpid-0.14-11
python-qpid-0.18-4

How reproducible:
100%

Steps to Reproduce:
1. create connection to not started broker with reconnect_timeout
2. call open()
3. check timestamps before open() call and after raised exception
  
Actual results:
reconnect_timeout is ignored

Expected results:
open() must raise exception after reconnect_timeout seconds

script used:
# cat test.py
#!/usr/bin/env python
from qpid.messaging import *
c = Connection("localhost", reconnect=True, reconnect_timeout=1)
c.open()
# time ./test.py
Comment 1 Justin Ross 2013-02-27 05:45:02 EST
*** Bug 735080 has been marked as a duplicate of this bug. ***
Comment 2 Ernie 2013-03-07 14:29:04 EST
Created attachment 706773 [details]
Uses reconnect and reconnect_timeout if supplied

Modifies open() to pass the reconnect_timeout value to attach()

Modifies attach() to use same logic as detach():
- accepts defaulted timeout argument
- passes timeout argument to _ewait
- inspects return from _ewait and raises Timeout exception if return was False
Comment 3 Justin Ross 2013-04-23 17:57:29 EDT
Firsst, in my checkout I modified one part of the patch:

ndex: qpid/messaging/endpoints.py
===================================================================
--- qpid/messaging/endpoints.py (revision 1471163)
+++ qpid/messaging/endpoints.py (working copy)
@@ -264,7 +264,10 @@
     if self._open:
       raise ConnectionError("already open")
     self._open = True
-    self.attach()
+    timeout = None
+    if self.reconnect and self.reconnect_timeout > 0:
+      timeout = self.reconnect_timeout
+    self.attach(timeout=timeout)

   @synchronized
   def opened(self):

I believe that's equivalent.

Second, is the code exercised in the tests?

Third, please link in a jira.
Comment 4 Ernie 2013-04-24 17:11:29 EDT
Created attachment 739604 [details]
Updated patch for reconnect and reconnect_timeout

Adds self.reconnect = False after a timeout to prevent the engine from continuing to retry.
Also adds the python endpoint test testConnectionOpen.
Comment 5 Justin Ross 2013-05-02 06:22:15 EDT
http://svn.apache.org/viewvc?view=revision&revision=1478313

-> POST
Comment 6 mick 2013-07-22 13:10:26 EDT
bug observed on RHEL 6.4, x86_64 

fix verified on RHEL 6.4 x { x86_64, i686 }

Nihil obstat.  Imprimatur.
Comment 8 errata-xmlrpc 2014-09-24 11:06:14 EDT
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.

http://rhn.redhat.com/errata/RHEA-2014-1296.html

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