Skip to content
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

MySQL locking up the whole application when trying to run actions in a tokio spawn #28

Closed
Power2All opened this issue Jul 18, 2022 · 2 comments

Comments

@Power2All
Copy link

Hi,

I'm pretty new to RUST, but I'm not understanding something.
I've got a shared Pool which I initialize using a trait so that we can switch easly to MySQL or SQLite3 management.
When using MySQL, I create a tokio spawn, in which it waits for a certain amount of time, to execute a Insert batch.
When doing this insert batch, it seems like it's literally locking and freezing the rest of the application until it's done.
What am I doing wrong here, do I need to use a different method to make sure the rest of the application keeps on going while a tokio spawn is doing it's work ?

Explanation is appreciated, or examples how to avoid this.

Kind regards.

@Power2All
Copy link
Author

Little add to this, colleague I'm working with, didn't wrap the pool inside a Arc<>, is that needed to make it work correctly in a threaded/async environment ? Basically, I'm running AXUM, which freeze up when the MySQL activity is happening, until it's done, and it continues again.

@Power2All
Copy link
Author

I stopped using this crate now.
Using SQLX, since it is fully async compatible.
Seems this crate is not meant to be used in async apps, unless I switch to deadpool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant