kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | a56267f89c4bff0e7a32f10791e2a16370d03d00d4c811d0a8de1eb4deb2c973 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-10-30 18:16 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-11-03 11:27 +01:00 |
| Parents | 324c75d775bf |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +7 −0
| @@ -76,6 +76,7 @@ | ||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | isInit = true; |
| 79 | + updateCreatedPools(executor()); | |
| 79 | 80 | return this; |
| 80 | 81 | } |
| 81 | 82 | |
| @@ -297,6 +298,12 @@ | ||
| 297 | 298 | * have one, and hosts that shouldn't don't. |
| 298 | 299 | */ |
| 299 | 300 | 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 | + | |
| 300 | 307 | try { |
| 301 | 308 | // We do 2 iterations, so that we add missing pools first, and them remove all unecessary pool second. |
| 302 | 309 | // That way, we'll avoid situation where we'll temporarily lose connectivity |