-
Notifications
You must be signed in to change notification settings - Fork 3
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
Redis Update to 0.24.0 #8
Conversation
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.
looks good!
looks like there are some issues with the upgrade within the tests. |
I'll check it |
Couldnt run the tests locally, it complained about docker. I fixed the compile error though, hoping that it was everything |
Nevermind, found the build script, gonna test in a bit |
I had the test running for over 2h, I don't know what the problem is for not finishing |
I can't get the cluster test running, but the pubsub test (that fails) is "working" (failing with the same error message). I tried to diagnose it, but I couldnt get it running. let monitor = rx.on_message::<String>().next().await.unwrap();
+ println!("{:?}", monitor); The failed test tells me this output: No matter what I do, I cant get the PING response, I am not clever enough to continue sadly. |
so strange. I ran a minimal viable product on windows to see what would occur and I got "1702321120.121350 [0 127.0.0.1:60182] "PING" "test"" using use futures::StreamExt;
use redis_pool::{RedisPool, SingleRedisPool};
use tokio::net::TcpListener;
#[tokio::main]
async fn main() {
// please consider using dotenvy to get this
// please check the docker-compose file included for the redis image used here
let redis_url = "redis://127.0.0.1:6379";
let client =
redis::Client::open(redis_url).expect("Error while tryiong to open the redis connection");
let pool = RedisPool::from(client);
let mut rx = pool
.factory()
.get_async_connection()
.await
.unwrap()
.into_monitor();
let _ = rx.monitor().await;
let mut tx = pool.aquire().await.unwrap();
let _: () = redis::cmd("PING")
.arg("test")
.query_async(&mut tx)
.await
.unwrap();
while let Some(string) = rx.on_message::<String>().next().await {
//let monitor = .unwrap();
//let monitor = monitor.split(" ").collect::<Vec<_>>();
println!("{:?}", string)
}
} Could you try running this code and seeing if it works. If so then the next thing is, Does the container break this. |
This is my system info, I wonder if this will help.
(this was run without any docker container at all, but right on the locally installed redis instance, unlike the tests |
I could not find any reason this is not working other than maybe something wrong with the Redis install for linux. As this should not be the libs fault its returning something that makes no utter sense. |
@genusistimelord from what I can tell on Linux it's returning CLIENT first time, then works as expected. use futures::StreamExt;
use redis_pool::{RedisPool, SingleRedisPool};
use tokio::net::TcpListener;
#[tokio::main]
async fn main() {
// please consider using dotenvy to get this
// please check the docker-compose file included for the redis image used here
let redis_url = "redis://127.0.0.1:6379";
let client =
redis::Client::open(redis_url).expect("Error while tryiong to open the redis connection");
let pool = RedisPool::from(client);
let mut rx = pool
.factory()
.get_async_connection()
.await
.unwrap()
.into_monitor();
let _ = rx.monitor().await;
let mut tx = pool.aquire().await.unwrap();
let _: () = redis::cmd("PING")
.arg("test")
.query_async(&mut tx)
.await
.unwrap();
let mut i = 0;
while let Some(string) = rx.on_message::<String>().next().await {
//let monitor = .unwrap();
//let monitor = monitor.split(" ").collect::<Vec<_>>();
println!("{:?}", string);
let _: () = redis::cmd("PING")
.arg("test")
.query_async(&mut tx)
.await
.unwrap();
i += 1;
if i > 3 {
break;
}
}
println!("end");
} Outputs:
Cargo.toml dependencies: [dependencies]
futures = "0.3.29"
redis = "0.24.0"
"redis_pool" = { git = "https://github.com/cking/RedisPool", branch = "main" }
tokio = { version = "1.35.0", features = ["full"] } |
Looks like it is a redis 7 thing. Running it against a |
not sure if it's this but in redis 7.2 they say to set the protocol version to RESP2 instead of RESP3 in clients before updating to prevent stuff breaking, their example is in Golang: client := redis.NewClient(&redis.Options{
Addr: "<database_endpoint>",
Protocol: 2, // Pin the protocol version
}) |
that could be possible but the issue seems to be in a brand new redis setup it was breaking within the container. But yeah redis RESP3 does seem to be the main issue causing the problem. |
No description provided.