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


##########
events.go:
##########
@@ -132,22 +132,257 @@ func (s *Session) handleEvent(framer *framer) {
        }
 }
 
+func (s *Session) hostInfoByIP(ip net.IP) *HostInfo {
+       if ip == nil {
+               return nil
+       }
+       host, _ := s.ring.getHostByIP(ip.String())
+       return host
+}
+
+func (s *Session) notifyTopologyChange(change string, host net.IP, port int) {
+       if s.cfg.Events.DisableTopologyEvents || s.topologyChangeListener == 
nil {
+               return
+       }
+
+       hostInfo := s.hostInfoByIP(host)

Review Comment:
   Good catch, potentially the driver can receive an event without having a 
host in the ring, probably it is also worth checking if host is accepted by the 
`HostFilter` before calling listener callbacks / log warnings



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