Skip to content

Commit

Permalink
Reconnect on a few more gocql errors (#4132)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc authored and yycptt committed Apr 17, 2023
1 parent 8f178a3 commit 16d53cb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"context"
"sync"
"sync/atomic"
"syscall"
"time"

"github.com/gocql/gocql"
Expand Down Expand Up @@ -181,7 +182,10 @@ func (s *session) handleError(
err error,
) {
switch err {
case gocql.ErrNoConnections:
case gocql.ErrNoConnections,
gocql.ErrSessionClosed,
gocql.ErrConnectionClosed,
syscall.ECONNRESET:
s.refresh()
default:
// noop
Expand Down

0 comments on commit 16d53cb

Please sign in to comment.