You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you do not set a large ReadTimeout on the client when using the monitor command then the socket timeout is hit but that error is never propagated back in any way so the channel listener is left in a blocked state.
Possible Solution
Either:
Update docs to inform users that they are responsible for detecting timeouts when listening to the channel
A ReadTimeout (or any other error) should be propagated back to user via closing the monitor channel
Steps to Reproduce
Start client
client := redis.NewClient(&redis.Options{
Addr: "127.0.0.1:6379",
// ReadTimeout: 1 * time.Minute,
})
stream := make(chan string, 1000)
monitorCmd := client.Monitor(ctx, stream)
monitorCmd.Start()
for {
var msg string
select {
case <-ctx.Done():
fmt.Println("ctx done")
case msg = <-stream:
fmt.Println("message")
}
fmt.Println(msg)
}
Wait a second and then via cli perform any redis operation
Check output from client
The text was updated successfully, but these errors were encountered:
Expected Behavior
Monitor command should work.
Current Behavior
If you do not set a large
ReadTimeout
on the client when using the monitor command then the socket timeout is hit but that error is never propagated back in any way so the channel listener is left in a blocked state.Possible Solution
Either:
ReadTimeout
(or any other error) should be propagated back to user via closing the monitor channelSteps to Reproduce
The text was updated successfully, but these errors were encountered: