RequestHandler.class should give more informative error messages

Description

If you set
Cluster.Builder()
.withLoadBalancingPolicy(new DCAwareRoundRobinPolicy("somecolothatdoesn'texist")

RequestHandler on line 103 will NOT tell you that is what went wrong.

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
August 21, 2014, 5:08 PM

This is the expected behavior: from the javadoc of DCAwareRoundRobinPolicy(localDc):

this is equivalent to {@code new DCAwareRoundRobinPolicy(localDc, 0)}

So you're telling it to use "foo" as the local datacenter, and use 0 remote hosts if no local hosts are available. The error message "All host(s) tried for query failed (no host was tried)" is appropriate.

I understand the confusion, but this could be a perfectly legitimate situation. Since the local datacenter could be down when the policy initializes, we have no way of detecting that you misspelled the datacenter name.

Sylvain Lebresne
August 22, 2014, 5:58 AM

I guess one simple thing we could do is log the local datacenter used at INFO during init. We do log it when the datacenter is autodetected but not otherwise. Having it logged might help people finding that kind of mistake a bit more easily.

Olivier Michallat
October 15, 2014, 6:08 PM

Added the log.

Fixed

Assignee

Olivier Michallat

Reporter

Adam

Labels

None

PM Priority

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Minor
Configure