Skip to content

Commit

Permalink
Merge pull request #150 from sylwiaszunejko/mark_node_down
Browse files Browse the repository at this point in the history
Mark node as down if unable to dial control conn
  • Loading branch information
avelanarius authored Oct 31, 2023
2 parents 7e10c93 + 01c3b3b commit 0545682
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions control.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ func (c *controlConn) attemptReconnectToAnyOfHosts(hosts []*HostInfo) (*Conn, er
for _, host := range hosts {
conn, err = c.session.connect(c.session.ctx, host, c)
if err != nil {
if c.session.cfg.ConvictionPolicy.AddFailure(err, host) {
c.session.handleNodeDown(host.ConnectAddress(), host.Port())
}
c.session.logger.Printf("gocql: unable to dial control conn %v:%v: %v\n", host.ConnectAddress(), host.Port(), err)
continue
}
Expand Down

0 comments on commit 0545682

Please sign in to comment.