Commit 6794c38
authored
JAVA-2057: Do not create pool when SUGGEST_UP topology event received (apache#1149)
Motivation:
There is a small window where a NEW_NODE event may be sent over the
control connection while a pool is initializing. This is more likely to
happen in testing, where a cluster is brought up and the driver connects
to it immediately.
In this case, the driver would erroneously create another pool, which
would create additional connections. The first pool created between
the currently initializing one and the new one being created would be
untracked with its connections remanining open even after the Session is
closed.
Modifications:
Change onTopologyEvent to no longer call createOrReconnectPool, instead
only call reconnectNow() if there is an already established pool.
initializing pool future present in the pending map.
Result:
SUGGEST_UP events now only trigger reconnect on existing pool, and will
no longer create a new pool.1 parent 0037cd3 commit 6794c38
2 files changed
Lines changed: 5 additions & 1 deletion
File tree
- changelog
- core/src/main/java/com/datastax/oss/driver/internal/core/session
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| |||
0 commit comments