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
I was working on a local setup, testing the monitor command with Redis.
While I could successfully capture all changes via the monitor command in redis-cli, I encountered an issue where no changes were captured after a certain period using the monitor command in the Go client.
After referring to the documentation, I found that the client needs to be blocked during the monitor command, and for prolonged monitor operations, the socket timeouts in Go client. After debugging, I discovered that this problem stemmed from the default configuration when initializing a new client. I addressed it by adding the ReadTimeout option with a value of -1.
From the doc:
// Timeout for socket reads. If reached, commands will fail
// with a timeout instead of blocking. Supported values:
// - `0` - default timeout (3 seconds).
// - `-1` - no timeout (block indefinitely).
// - `-2` - disables SetReadDeadline calls completely.
ReadTimeout time.Duration
Proposal:
I suggest adding an additional help message to the monitor command, the monitor_test or stating explicitly how to make the connection blocking
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I was working on a local setup, testing the monitor command with Redis.
While I could successfully capture all changes via the monitor command in redis-cli, I encountered an issue where no changes were captured after a certain period using the monitor command in the Go client.
After referring to the documentation, I found that the client needs to be blocked during the monitor command, and for prolonged monitor operations, the socket timeouts in Go client. After debugging, I discovered that this problem stemmed from the default configuration when initializing a new client. I addressed it by adding the ReadTimeout option with a value of -1.
From the doc:
Before:
After:
Proposal:
I suggest adding an additional help message to the monitor command, the monitor_test or stating explicitly how to make the connection blocking
Setup to reproduce:
go: 1.22
arch: arm64
Kind regards,
Beta Was this translation helpful? Give feedback.
All reactions