-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Task mixing #95
Comments
That's pretty surprising! It does indeed seem like there's an issue here with the |
I noticed this in the Redis docs:
Is your client subscribed to a channel or pattern? |
(Note that you don't need to bump the tokio dependency to 1.1 in the bb8 dependencies explicitly, since 1.1 is semver-compatible with 1.0. You can just use tokio 1.1 in your downstream dependency/application, and bb8 should pick it up.) |
Any chance it may be connected with redis-rs/redis-rs#308 ? |
Also we can have a look how it is implemented in mobc: https://github.com/importcjj/mobc/blob/87ae0152a51c0526caee9bd87455acf20cc778cb/mobc-redis/src/lib.rs#L30 |
no, we don't |
@invis87 maybe you can try with the explicit return type as suggested in redis-rs/redis-rs#308? |
@djc I already have it: |
I meant in the |
I don't know how to reproduce that bug. Sometimes service "moved to buggy state" and then there are a lot of Buuut, I will try to fix |
Hmmm, interesting!
Service still have On the other hand, with deps:
Number if errors is |
That is surprising. Did you correct for other differences in the |
Hmmm, after night Here is the diff:
Am I the only one who use
|
@djc look what Ive found: importcjj/mobc#28 |
Yeah, I'm guessing this is actually due to redis-rs/redis-rs#325 and bb8 is actually not causing this. |
@djc A workaround would be using As the semantics are not the same maybe this should be done through a feature flag or an other adapter? |
@Barre I think that would make sense. Please submit it without a feature flag first, and explain a bit more in the PR about any changes in the semantics that you expect/are documented. |
Copypasted of issue that I create in tokio: tokio-rs/tokio#3500
Version
cargo tree | grep redis
:cargo tree | grep bb8
:Platform
Linux videotest01.dev.wb.ru 4.19.0-13-cloud-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
Description
After moving to Tokio v1.0.1 our "reddis-proxy" service start to fail with "magic" errors:
Response was of incompatible type: "Response type not hashmap compatible" (response was status("PONG"))
This error happens when we call
let response: redis::RedisResult<collections::HashMap<String, String>> = conn.hgetall(key).await;
Looks like async tasks mixed somehow and
hgetall
get response fromPING
request. Do not know where to dig into, will try with newer version of tokio...We have async fn:
That called ~10 times per second. And sometimes (in 10-20% cases) this line says:
Response was of incompatible type: "Response type not hashmap compatible" (response was status("PONG"))
.Redis-pool have logic inside, that sends
PING
requests to validate connection (I think it do that before each request in my case). So, looks like response on that requests goes in wrong future task... it is the only way (as I think) whyhgetall
can receivePONG
string as a response. We do not have those values in redis.And all works fine before we moved to tokio 1.x
The text was updated successfully, but these errors were encountered: