Red Hat Bugzilla – Bug 896570
retries parameter ignored for the very first broker
Last modified: 2014-09-24 11:05:18 EDT
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)
Created attachment 687306 [details] Simple patch proposal Constructor of FailoverRoundRobinServers class misses calling setBroker method that sets up variables like _serverRetries.
http://svn.apache.org/r1456131 Applied Pavel's patch.
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
Created attachment 777889 [details] Renamed reproducer
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
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