Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 896570 - retries parameter ignored for the very first broker
retries parameter ignored for the very first broker
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java (Show other bugs)
2.2
All Linux
medium Severity medium
: 3.0
: ---
Assigned To: Rajith Attapattu
Ernie
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-17 09:46 EST by Pavel Moravec
Modified: 2014-09-24 11:05 EDT (History)
4 users (show)

See Also:
Fixed In Version: qpid-java-0.22-1.el5, qpid-java-0.22-2.el6
Doc Type: Bug Fix
Doc Text:
It was discovered that when the current broker details were not set, the _serverRetries parameter was set to zero. This caused the Java client failover to not attempt to retry after the very first connection loss to the broker it was already connected to. The fix sets the current broker details in the constructor, which ensures the retry parameter is honored on the first broker when set.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-24 11:05:18 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)
Simple patch proposal (694 bytes, patch)
2013-01-25 03:21 EST, Pavel Moravec
no flags Details | Diff
Reproducer (1.62 KB, text/x-java)
2013-07-24 13:57 EDT, Ernie
no flags Details
Renamed reproducer (1.62 KB, text/x-java)
2013-07-24 14:06 EDT, Ernie
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-4549 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 Pavel Moravec 2013-01-17 09:46:56 EST
Description of problem:
Java client failover does not attempt to retry after failover to the very first broker it tries to connect at the beginning.


Version-Release number of selected component (if applicable):
0.18-6.el6


How reproducible:
100%


Steps to Reproduce:
1. Have a client with connectionURL:
amqp://guest:guest@test/?brokerlist='tcp://node1:5672?retries='1000'&connectdelay='300'&connecttimeout='10000';tcp://node2:5672?retries='1000'&connectdelay='300'&connecttimeout='10000';tcp://node3:5672?retries='1000'&connectdelay='300'&connecttimeout='10000''

2. Start all three brokers and connect the client - it will connect to node1
3. Restart node1 broker (such that the restart is completed very soon)
4. Check in Java logs how the client fail-overs

  
Actual results:
- Java client does not attempt to re-connect to node1 anyhow (per Java logs), it immediately tries node2
- checking tcpdump, the client does connection attempt to node1 but only after (e.g. 0.5 second later) it is successfully connected to node2 (and the connection to node1 is dropped after some short time)


Expected results:
- Java client applies retries, connectdelay and connecttimeout options also to node1


Additional info:
- IMPORTANT: continuing the scenario and shutting down for a longer time node2 and node3 (such that at the end the client fails over back to node1), and restarting node1 now, the retry mechanism _is_ applied to node1
- the bug affects just the broker where the client tries to connect to in its first attempt (regardless if the client succeeds or not - per another tests)
Comment 1 Pavel Moravec 2013-01-25 03:21:26 EST
Created attachment 687306 [details]
Simple patch proposal

Constructor of FailoverRoundRobinServers class misses calling setBroker method that sets up variables like _serverRetries.
Comment 2 Rajith Attapattu 2013-03-13 17:26:20 EDT
http://svn.apache.org/r1456131
Applied Pavel's patch.
Comment 3 Ernie 2013-07-24 13:57:47 EDT
Created attachment 777888 [details]
Reproducer

Creates connectionlist with 3 brokers with appropriate timeout/connection values.
Keeps connection open by creating consumer and calling receive with no timeout.
To use, start brokers on ports 5681, 5682, and 5683
Comment 4 Ernie 2013-07-24 14:06:48 EDT
Created attachment 777889 [details]
Renamed reproducer
Comment 5 Ernie 2013-07-24 15:05:55 EDT
Verified on rhel 6.4 32/64
qpid-java-client-0.22-4.el6.noarch
qpid-java-common-0.22-4.el6.noarch
qpid-java-example-0.22-4.el6.noarch

Java client applies retries, connectdelay and connecttimeout options on 1st broker in the connection brokerlist.


Reproduced on rhel 6.4 64
qpid-java-client-0.18-7.el6.noarch
qpid-java-example-0.18-7.el6.noarch
qpid-java-common-0.18-7.el6.noarch
Comment 8 errata-xmlrpc 2014-09-24 11:05:18 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.