Our threads are dying and the application grinds to a halt because of a NPE thrown from HostConnectionPool.discardAvailableConnections().
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?
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?
No, the next version on the 2.1 branch to have this fix will be 2.1.3. It's not out yet.
Thanks for the info, Olivier.
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 ?