Skip to content

Misleading exception thrown when dynamo can't connect to any node in cluster #15

Description

@maryoush

This happens when nodes denoted as dynamo cluster hosts are not available (see attached project)

We receive somewhere in logs

[WARN] [com.netflix.dyno.connectionpool.impl.HostConnectionPoolImpl] Unable to make any successful connections to host Host [hostname=localhost, ipAddress=127.0.0.1, port=8102, rack: rack1, status: Up]

but the exception which is being received while calling

 DynoJedisClient dynoClient = new DynoJedisClient.Builder()  //
                .withApplicationName("appname")   //
                .withHostSupplier(customHostSupplier)  //
                .withCPConfig(connectionPoolConfiguration)//
                .build();

is ugly ArrayIndexOutOfBoundsException

Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 0
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.startConnectionPool(DynoJedisClient.java:3414)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.buildDynoJedisClient(DynoJedisClient.java:3383)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.build(DynoJedisClient.java:3302)
	at com.hybris.decay.client.DynoQueueClient.<init>(DynoQueueClient.java:62)
	at com.hybris.decay.client.DynoQueueClient.<init>(DynoQueueClient.java:38)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
	... 77 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at com.netflix.dyno.connectionpool.impl.lb.HostSelectionWithFallback.calculateReplicationFactor(HostSelectionWithFallback.java:389)
	at com.netflix.dyno.connectionpool.impl.lb.HostSelectionWithFallback.initWithHosts(HostSelectionWithFallback.java:346)
	at com.netflix.dyno.connectionpool.impl.ConnectionPoolImpl.initSelectionStrategy(ConnectionPoolImpl.java:605)
	at com.netflix.dyno.connectionpool.impl.ConnectionPoolImpl.start(ConnectionPoolImpl.java:505)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.startConnectionPool(DynoJedisClient.java:3397)
	... 86 more

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions