Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #387 Panic if Redis client returns use of closed network connection #628

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/source/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func (a *Adapter) processEntry(ctx context.Context, conn redis.Conn, streamName
reply, err := conn.Do("XREADGROUP", "GROUP", groupName, consumerName, "COUNT", count, "BLOCK", blockms, "STREAMS", streamName, xreadID)
if err != nil {
a.logger.Error("Cannot read from stream", zap.Error(err))
if strings.Contains(strings.ToLower(err.Error()), "use of closed network connection") { // Redis has probably been shut down
panic("Redis has been shut down")
}
if !isShuttingDown {
time.Sleep(1 * time.Second)
}
Expand Down
Loading