worryg0d commented on code in PR #1944:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1944#discussion_r3109767758
##########
host_source.go:
##########
@@ -806,7 +811,9 @@ func (r *ringDescriber) getClusterPeerInfo(localHost
*HostInfo) ([]*HostInfo, er
// Return true if the host is a valid peer
func isValidPeer(host *HostInfo) bool {
- return !(len(host.RPCAddress()) == 0 ||
+ host.mu.RLock()
+ defer host.mu.RUnlock()
+ return !(len(host.rpcAddress) == 0 ||
Review Comment:
Unsure if we ever need a lock here. It is called by `getClusterPeerInfo` and
`awaitSchemaAgreementWithTimeout`, and both send select queries to the DB for
the **system_peers** tables, thereby instantiating new `HostInfo` objects.
##########
host_source.go:
##########
@@ -484,10 +492,7 @@ func (h *HostInfo) String() string {
// Polls system.peers at a specific interval to find new hosts
type ringDescriber struct {
- session *Session
- mu sync.Mutex
- prevHosts []*HostInfo
- prevPartitioner string
Review Comment:
I just realized they are never used
--
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]