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

monitor command breaks due to ReadTimeout #3079

Open
stlava opened this issue Aug 4, 2024 · 0 comments
Open

monitor command breaks due to ReadTimeout #3079

stlava opened this issue Aug 4, 2024 · 0 comments

Comments

@stlava
Copy link

stlava commented Aug 4, 2024

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:

  1. Update docs to inform users that they are responsible for detecting timeouts when listening to the channel
  2. A ReadTimeout (or any other error) should be propagated back to user via closing the monitor channel

Steps to Reproduce

  1. 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)
	}
  1. Wait a second and then via cli perform any redis operation
  2. Check output from client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant