-
Notifications
You must be signed in to change notification settings - Fork 85
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
bugfix: reading from a silent stream should not fail with RedisCommandTimeoutException
#952
base: series/1.x
Are you sure you want to change the base?
Conversation
…ndTimeoutException` If the stream has no data for a long time, lettuce will throw `RedisCommandTimeoutException`. In that case we don't want to fail the stream and we should restart the read.
RedisCommndTimeoutException
RedisCommandTimeoutException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY
@arturaz I think I was a bit too hasty, I have had more time to look at this in detail.
If block was not used , then a timeout exception occurred most likely due to underlying network latency issues (as you can see from the myriad of issues raised here In that case perhaps this should be viewed as a feature and require opt in by the user I would also expect in the test scenario added, where one explicitly sets a timeout in the client options, the stream would be shutdown in that case. |
My case uses default option, which is I will take a look at rewriting this using the reactive redis API instead of async one to see if that helps. |
Note: this breaks the silent stream test for now.
I migrated streaming to reactive Lettuce API, which, unfortunately, still raises the timeout exception if the stream is silent. However, I still think it's a better option than repeatedly polling using async API. The simple use case (without restarts) is very straightforward now. I also added |
Putting aside the switch to the Reactive API, as you are correct , as noted , it wont solve this problem.
Using the default configs for a client would result in having a CommandTimeout set to 60 seconds as its inherited by default from the connection config which has a default of 60 seconds The command timeout mechanism is ignorant of the api choice (sync/async/reactive) and will timeout regardless . See this for discussion around CommandTimeout for blocking commands In fact in the history of Redis4Cats , there is discussion if this was a wise decision to set block to 0 as default. |
So is there a problem with the added feature? |
If the stream has no data for a long time, lettuce will throw
RedisCommandTimeoutException
.In that case we don't want to fail the stream and we should restart the read.
Alternatively we should use the lettuce reactive API, but that requires quite a large of a refactoring.