Skip to content

Commit 0545682

Browse files
authored
Merge pull request #150 from sylwiaszunejko/mark_node_down
Mark node as down if unable to dial control conn
2 parents 7e10c93 + 01c3b3b commit 0545682

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)