jahstreet commented on code in PR #2007:
URL:
https://github.com/apache/cassandra-java-driver/pull/2007#discussion_r1934131391
##########
core/src/main/java/com/datastax/oss/driver/internal/core/session/PoolManager.java:
##########
@@ -221,18 +222,23 @@ private void init(CqlIdentifier keyspace) {
stateEventFilter.start();
Collection<Node> nodes =
context.getMetadataManager().getMetadata().getNodes().values();
- List<CompletionStage<ChannelPool>> poolStages = new
ArrayList<>(nodes.size());
+ Map<Node, CompletionStage<ChannelPool>> poolStageByNode = new
HashMap<>(nodes.size());
Review Comment:
Indeed, it deduplicates `DefaultNode`s by reference, which is also the case
down the line in
https://github.com/apache/cassandra-java-driver/pull/2007/files#diff-79645c264b633a5c25cadd4cfd581e8ae06fb41a1adc5f51087ccc46ce0d7452R258.
Then we look up pools by node instance as well on requests in
`DefaultSession#getChannel`.
No matter the node implementation, we need to make sure we do not `leak`
pools by losing them on `pools#put` with the same key.
On the other side, if we key by `EndPoint`, then we also need to get by
`EndPoint`, cause otherwise on requests we risk to not find the desired pool
for the filtered out node instance.
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]