Skip to content

Commit 9479bc1

Browse files
committed
redis: increase pubsub channel buffer to prevent message drops
The go-redis pubsub.Channel() defaults to a buffer of 100 messages. Under concurrent writes (e.g. max_in_flight=10 publishing batches of 100), the buffer overflows and messages are silently dropped since Redis PubSub is fire-and-forget. Increase buffer to 2000. Fixes CON-411
1 parent cb78ded commit 9479bc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/impl/redis/input_pubsub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (r *redisPubSubReader) Read(ctx context.Context) (*service.Message, service
145145
}
146146

147147
select {
148-
case rMsg, open := <-pubsub.Channel():
148+
case rMsg, open := <-pubsub.Channel(redis.WithChannelSize(2000)):
149149
if !open {
150150
_ = r.disconnect()
151151
return nil, nil, service.ErrEndOfInput

0 commit comments

Comments
 (0)