-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fixed blocking command to be timed out based on the specified command argument #1283
Conversation
400ece5
to
911d098
Compare
26cbe61
to
c3a67f1
Compare
fn get_request_timeout(cmd: &Cmd, default_timeout: Duration) -> Option<Duration> { | ||
let command = cmd.command().unwrap_or_default(); | ||
let timeout = match command.as_slice() { | ||
b"BLPOP" | b"BRPOP" | b"BLMOVE" | b"BZPOPMAX" | b"BZPOPMIN" | b"BRPOPLPUSH" => { |
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.
This has potential to miss the future commands having timeouts - we should add reference to this function to the "integrating new-commands" SOP.
In addition we should have an automatic test like this (for redis):
- pull the target server commands.json
- detect commands with the timeout param
- check we handle each command correctly
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.
@ikolomi Can you create an issue for that?
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.
2558dd0
to
9e6acd4
Compare
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.
LGTM, but couple of questions left
await redis_client.info(route=ByAddressRoute("foo")) | ||
|
||
|
||
@pytest.mark.asyncio |
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.
good to test: blpop with timeout 1 sec blocks for ~1 sec even if the request timeout set to 100 millis or so
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.
I test it on the core
c6496a7
to
7eda646
Compare
LGTM |
Currently, blocking commands are being timed out based on the client's request timeout. Since blocking commands contain a timeout argument, we should use this command-specific timeout to determine when to terminate