Issue #34 resolved

Destination type weighted-with-fail-over not able to failover

Anonymous created an issue

I attached a simple testcase which starts 2 jetty servers (localhost:9000 and localhost:9001), sends 50 messages through UltraESB (with simple HTTP proxy service with weighted-with-fail-over), stops the second server and then tries to send another 50 messages.
It tries to send to stopped server and gets connection timeout, next it tries to select next candidate address but fails to choose server1 address. Something is wrong with weight predicate in this code:

            case WEIGHTED_W_FO:
                double rand = random.nextDouble();
                for (Address candidate : candidates) {
                    if (candidate.isWeightInRange(rand)) {
                        selected = candidate;
                    }
                }
                break;

From logs:

01-11 12:20:44,042 primary-20           DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [922] : Selecting address to use from map of size : 2 last address used was : address-1
01-11 12:20:44,042 primary-20           DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [931] : Address : {address-1=>http://localhost:9000} is in state : active tried already : false
01-11 12:20:44,042 primary-20           DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [931] : Address : {address-2=>http://localhost:9001} is in state : active tried already : false
01-11 12:20:44,043 primary-20           DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [966] : Last selected address is in position : 0 from size : 2
01-11 12:20:44,043 primary-20           DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [              submitNewMessage] [535] : Endpoint : MyProxyService-inDestination selected Address : http://localhost:9001
01-11 12:20:44,043 primary-20           TRACE [                       http.util.ConnectionManager] [                 getConnection] [ 81] : No connections to : localhost:9001 available for reuse
01-11 12:20:44,043 primary-20           DEBUG [                      transport.http.HttpNIOSender] [                          send] [573] : A new connection will be opened to : localhost on port : 9001
01-11 12:20:44,044 primary-20           DEBUG [                         ultraesb.core.MessageImpl] [                 endProcessing] [305] : Message ID : 2d1ba29b-a3e2-40fe-aa60-1b36f83d9d45 has completed processing under : MyProxyService Pending completion by : [[MyProxyService-inDestination]]
01-11 12:20:44,044 primary-20           DEBUG [                  core.ProxyService.MyProxyService] [                    doRealWork] [371] : Processing of message completed for proxy service : MyProxyService in state : Started current execution count : 0 current polling count : 0
01-11 12:20:44,044 HttpNIOSender-http-sender DEBUG [transport.http.HttpNIOSender$SessionRequestCallback] [                        failed] [698] : Connect request failed : localhost/127.0.0.1:9001
01-11 12:20:44,060 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [                 notifyFailure] [811] : Endpoint MyProxyService-inDestination failed, with error code 101503 : Connect attempt to server failed
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [                 notifyFailure] [858] : Safe to ignore error codes : [101508, 101503, 101510] and retry
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [922] : Selecting address to use from map of size : 2 last address used was : address-2
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [931] : Address : {address-1=>http://localhost:9000} is in state : active tried already : false
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [931] : Address : {address-2=>http://localhost:9001} is in state : active tried already : true
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [       getAddressToUseFromList] [966] : Last selected address is in position : -1 from size : 1
01-11 12:20:44,061 HttpNIOSender-http-sender WARN  [    endpoint.Endpoint.MyProxyService-inDestination] [              submitNewMessage] [541] : The Endpoint : MyProxyService-inDestination has no ACTIVE addresses to use
01-11 12:20:44,061 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [                 notifyFailure] [811] : Endpoint MyProxyService-inDestination failed, with error code 800000 : No ready address available
01-11 12:20:44,062 HttpNIOSender-http-sender DEBUG [    endpoint.Endpoint.MyProxyService-inDestination] [            invokeErrorHandler] [554] : Invoking fault handler of endpoint : MyProxyService-inDestination

Comments (3)

  1. Log in to comment