Skip to content
Open
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")
}
Comment on lines +186 to +188
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more graceful way to handle this error? From the original issue, it seems like the proposed solution is:

Eventing-redis should reopen a socket when the error is "use of closed network connection".

I imagine that with this panicking, it will eventually be restarted and that would reopen the socket. But, I feel like we could handle this more gracefully. WDYT?

if !isShuttingDown {
time.Sleep(1 * time.Second)
}
Expand Down
Loading