Skip to content

Commit

Permalink
Pre-emptively recover sqlx close panics
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail authored and lucasoares committed Mar 8, 2024
1 parent eb08f57 commit b89b33c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/impl/cockroachdb/input_changefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ func (c *crdbChangefeedInput) Connect(ctx context.Context) (err error) {
}

func (c *crdbChangefeedInput) closeConnection() {
defer func() {
if r := recover(); r != nil {
c.logger.Errorf("Recovered connection close panic: %v", r)
}
}()

c.dbMut.Lock()
defer c.dbMut.Unlock()

Expand Down

0 comments on commit b89b33c

Please sign in to comment.