Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 896570

Summary: retries parameter ignored for the very first broker
Product: Red Hat Enterprise MRG Reporter: Pavel Moravec <pmoravec>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED ERRATA QA Contact: Ernie <eallen>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.2CC: eallen, jross, lzhaldyb, sauchter
Target Milestone: 3.0Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 15:05:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Simple patch proposal
none
Reproducer
none
Renamed reproducer none

Description Pavel Moravec 2013-01-17 14:46:56 UTC
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 08:21:26 UTC
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 21:26:20 UTC
http://svn.apache.org/r1456131
Applied Pavel's patch.

Comment 3 Ernie 2013-07-24 17:57:47 UTC
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 18:06:48 UTC
Created attachment 777889 [details]
Renamed reproducer

Comment 5 Ernie 2013-07-24 19:05:55 UTC
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 15:05:18 UTC
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