worryg0d commented on code in PR #1920:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1920#discussion_r2572096277


##########
control.go:
##########
@@ -262,26 +217,27 @@ func (c *controlConn) discoverProtocol(hosts []*HostInfo) 
(int, error) {
 
        var err error
        for _, host := range hosts {
-               var conn *Conn
-               conn, err = c.session.dial(c.session.ctx, host, &connCfg, 
handler)
-               if conn != nil {
-                       conn.Close()
-               }
+               connCfg := *c.session.connCfg
+               for proto := highestProtocolVersionSupported; proto >= 
lowestProtocolVersionSupported; proto-- {
+                       connCfg.ProtoVersion = proto
+
+                       var conn *Conn
+                       conn, err = c.session.dial(c.session.ctx, host, 
&connCfg, handler)
+                       if conn != nil {
+                               conn.Close()
+                       }
 
-               if err == nil {
-                       c.session.logger.Debug("Discovered protocol version 
using host.",
-                               NewLogFieldInt("protocol_version", 
connCfg.ProtoVersion), NewLogFieldIP("host_addr", host.ConnectAddress()), 
NewLogFieldString("host_id", host.HostID()))
-                       return connCfg.ProtoVersion, nil
-               }
+                       if err == nil {
+                               c.session.logger.Debug("Discovered protocol 
version using host.",
+                                       NewLogFieldInt("protocol_version", 
connCfg.ProtoVersion), NewLogFieldIP("host_addr", host.ConnectAddress()))

Review Comment:
   Yes, it is not populated, so there is really no useful information 



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