Elffuss BraidHub

kikocis/java-driver public

Don't run updateCreatedPools during session initialization (JAVA-522).
Changeseta56267f89c4bff0e7a32f10791e2a16370d03d00d4c811d0a8de1eb4deb2c973
Authorolim7t <omichallat+github@gmail.com> · 2014-10-30 18:16 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2014-11-03 11:27 +01:00
Parents324c75d775bf

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +7 −0
@@ -76,6 +76,7 @@
7676 }
7777 }
7878 isInit = true;
79+ updateCreatedPools(executor());
7980 return this;
8081 }
8182
@@ -297,6 +298,12 @@
297298 * have one, and hosts that shouldn't don't.
298299 */
299300 void updateCreatedPools(ListeningExecutorService executor) {
301+ // Don't run this during initialization, as some hosts may be non-responsive but not yet marked DOWN, and
302+ // we would try to create their pool over and over again.
303+ // We run it once at the end of init().
304+ if (!isInit)
305+ return;
306+
300307 try {
301308 // We do 2 iterations, so that we add missing pools first, and them remove all unecessary pool second.
302309 // That way, we'll avoid situation where we'll temporarily lose connectivity