Skip to content

Commit

Permalink
Add host failure handling
Browse files Browse the repository at this point in the history
Without this when restarting node with increased assigned
resources happen there was a panic due to wrong number of
shards.
  • Loading branch information
sylwiaszunejko committed Oct 12, 2023
1 parent 61be561 commit 0c96368
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 0c96368

Please sign in to comment.