Skip to content

Commit 01c3b3b

Browse files
Mark node as down if unable to dial control conn
Without this if during restart the resources assigned to node change, the driver does not update this. That could lead to outdated information about threads/shards.
1 parent 7e10c93 commit 01c3b3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

control.go

+3
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ func (c *controlConn) attemptReconnectToAnyOfHosts(hosts []*HostInfo) (*Conn, er
401401
for _, host := range hosts {
402402
conn, err = c.session.connect(c.session.ctx, host, c)
403403
if err != nil {
404+
if c.session.cfg.ConvictionPolicy.AddFailure(err, host) {
405+
c.session.handleNodeDown(host.ConnectAddress(), host.Port())
406+
}
404407
c.session.logger.Printf("gocql: unable to dial control conn %v:%v: %v\n", host.ConnectAddress(), host.Port(), err)
405408
continue
406409
}

0 commit comments

Comments
 (0)