jameshartig commented on code in PR #1915:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1915#discussion_r2462272759


##########
session.go:
##########
@@ -199,6 +186,20 @@ func NewSession(cfg ClusterConfig) (*Session, error) {
        }
        s.connCfg = connCfg
 
+       if cfg.PoolConfig.HostSelectionPolicy == nil {
+               cfg.PoolConfig.HostSelectionPolicy = RoundRobinHostPolicy()
+       }
+       s.pool = cfg.PoolConfig.buildPool(s)
+       s.policy = cfg.PoolConfig.HostSelectionPolicy
+
+       // set the executor here in case the policy needs to execute queries in 
Init

Review Comment:
   Its not obvious right now because it's called `Init` and it's passed a 
session but it doesn't say the session isn't ready or isn't usable. If the 
policy is ready there isn't a reason why the policy should have assumed the 
session isn't.
   
   I'm not arguing that we change things but we should at least document the 
intention of init and the state of the session.



-- 
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]

Reply via email to