Fixed blocking command to be timed out based on the specified command argument#1283
Fixed blocking command to be timed out based on the specified command argument#1283barshaul merged 3 commits intovalkey-io:mainfrom
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.
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.
@ikolomi Can you create an issue for that?
2558dd0 to
9e6acd4
Compare
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
LGTM, but couple of questions left
| await redis_client.info(route=ByAddressRoute("foo")) | ||
|
|
||
|
|
||
| @pytest.mark.asyncio |
There was a problem hiding this comment.
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.
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