NPE on HostConnectionPool.discardAvailableConnections

Description

Our threads are dying and the application grinds to a halt because of a NPE thrown from HostConnectionPool.discardAvailableConnections().

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
October 15, 2014, 5:46 PM

Fixed.

The scenario is this: one of the initial connections of the pool is created and initialized successfully, but it fails right after (for instance if the node goes down), just before the pool is fully constructed. This is almost impossible to formalize in a unit test, but I was able to reproduce it by placing a breakpoint in the pool constructor and simulating the error.

Out of curiosity, did you get this more than one time?

Constantin Muraru
October 15, 2014, 5:52 PM

Yes, we got the exception on several servers multiple times during an outage of some Cassandra nodes.
We plan to upgrade to 2.1.1. Is that going to fix this issue as well?

Thanks.

Olivier Michallat
October 15, 2014, 6:12 PM

No, the next version on the 2.1 branch to have this fix will be 2.1.3. It's not out yet.

Constantin Muraru
October 16, 2014, 4:31 PM

Thanks for the info, Olivier.

Pierre Laporte
October 21, 2014, 6:09 PM

I don't understand how it is actually possible, as of 2.0.4, to have a connections field uninitialized...

This field is final and receives its value in the only existing constructor of HostConnectionPool. And if the constructor throws an exception just before it receives its value, then no instance is actually created. Am I missing something ?

Fixed

Assignee

Olivier Michallat

Reporter

Constantin Muraru

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Major
Configure