-
Notifications
You must be signed in to change notification settings - Fork 114
-
Notifications
You must be signed in to change notification settings - Fork 114
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
PacketOutOfOrder error on connect with too many connections #96
Comments
Note that the test above will appear to pass. You'll need to run it with |
In my experience, the test above fails if the number of connections established is |
I have a weak suspicion that this might be related to #94. @blackbeam can you reproduce this issue? It should be relatively self-contained and easy enough to debug given that you know the protocol :) Especially because it doesn't require much concurrency at all. |
I just ran into this issue again today sadly, so doesn't appear to have been fixed by the resolution to #94. |
Oh, this is quite sad. I'll look into it again. |
Please note that the biggest problem for me here was to reproduce this issue (I simply couldn't). |
This was on an EC2 Ubuntu machine, running latest LTS, with the latest MariaDB version available there. |
Btw, which version of |
This was with |
I've tried to reproduce it on t2.micro instance with bionic and stock MariaDB 10.1.44. Maybe I'm missing something? Here is the code: use mysql_async::{Conn, prelude::*};
use std::future::Future;
#[tokio::main(core_threads=8)]
async fn main() {
use futures::stream::StreamExt;
for _ in 0..100_000 {
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel::<()>();
for i in 0..160 {
let tx = tx.clone();
tokio::spawn(async move {
let c = Conn::new("mysql://user:password@127.0.0.1/mysql").await.unwrap();
let c = c.drop_query("SELECT 1").await.unwrap();
c.disconnect().await.unwrap();
drop(tx);
});
}
drop(tx);
assert_eq!(rx.next().await, None);
}
} |
That's very weird — I don't have a good answer for you unfortunately. It could be that it only happens when there's significant concurrency, which might require more cores than a t2.micro. I'm running on a 16-core instance when I see the issue. |
Hi, @jonhoo. Could you please test the following revision in your environment? [dependencies]
mysql_async = { git = "https://github.com/blackbeam/mysql_async.git", rev = "4602469d303321ca4a307c7377b8502e8b5a77cf" } |
Ooh, interesting, #4602469d303321ca4a307c7377b8502e8b5a77cf does look like a promising fix! Unfortunately I'm pretty swamped in the coming month(s) as I'm also moving cross-country, so may not be able to test this for a while. I'll add it to my backlog though! |
Conn::new
returns aPacketOutOfOrder
error if too many connections are established at the same time to a MySQL database. This doesn't seem like the right error to return? You can try this with something like:Which will panic at
Conn::new(get_opts()).await.unwrap()
(expected) with aPacketOutOfOrder
error (unexpected).The text was updated successfully, but these errors were encountered: