joao-r-reis commented on code in PR #1929:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1929#discussion_r2794768129
##########
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:
if we don't find the host we should log a warning and skip the listener
callbacks.
--
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]