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

Panic while getting connection from pool (support for tokio-0.3?) #132

Closed
rohitjoshi opened this issue Nov 3, 2020 · 6 comments
Closed

Comments

@rohitjoshi
Copy link

With the tokio-0.3.3, I am seeing panic error while getting connection from the pool. This was working fine with tokio-2.x version.

tokio version:0.3.3
mysql_asybc: 0.25.0

tokio runtime created using: Builder::new_multi_thread()

  0:        0x10f5a9394 - std::backtrace_rs::backtrace::libunwind::trace::hb4ff9014ec5817b3
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:        0x10f5a9394 - std::backtrace_rs::backtrace::trace_unsynchronized::h0d03cf0f7c5d8d01
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x10f5a9394 - std::sys_common::backtrace::_print_fmt::h5b2bf2921eea85ae
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x10f5a9394 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h808cc0fc691f5922
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/sys_common/backtrace.rs:46:22
   4:        0x10f5ceb30 - core::fmt::write::h0ce880d33cd2a300
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/core/src/fmt/mod.rs:1076:17
   5:        0x10f5a1b46 - std::io::Write::write_fmt::h057e6b5365b25cdb
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/io/mod.rs:1516:15
   6:        0x10f5ab4d9 - std::sys_common::backtrace::_print::ha1932a5f36d2b146
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/sys_common/backtrace.rs:49:5
   7:        0x10f5ab4d9 - std::sys_common::backtrace::print::had07999cb13bdf77
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/sys_common/backtrace.rs:36:9
   8:        0x10f5ab4d9 - std::panicking::default_hook::{{closure}}::hcbe1ecfff77305a1
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/panicking.rs:208:50
   9:        0x10f5ab19d - std::panicking::default_hook::h8422621c02c35b35
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/panicking.rs:227:9
  10:        0x10f5abaab - std::panicking::rust_panic_with_hook::h82b76d3adf4cbc3a
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/panicking.rs:577:17
  11:        0x10f5ab62b - std::panicking::begin_panic_handler::{{closure}}::h1e3858c0f26acd6d
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/panicking.rs:484:9
  12:        0x10f5a9838 - std::sys_common::backtrace::__rust_end_short_backtrace::hb43bfc309d1c5e68
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/sys_common/backtrace.rs:141:18
  13:        0x10f5ab5ea - rust_begin_unwind
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/std/src/panicking.rs:483:5
  14:        0x10f5f4f2f - core::panicking::panic_fmt::h33aee6f32da9c3a4
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/core/src/panicking.rs:85:14
  15:        0x10f5f4dba - core::option::expect_failed::he41d9b6b925c99b1
                               at /rustc/ffa2e7ae8fbf9badc035740db949b9dae271c29f/library/core/src/option.rs:1260:5
  16:        0x10eeb0dde - core::option::Option<T>::expect::ha8ead4dbfc53f3b9
                               at /Users/xxx/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:349:21
  17:        0x10ee93b45 - tokio::task::spawn::spawn::h35bd0066fc875c3c
                               at /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/task/spawn.rs:130:28
  18:        0x10ee44c64 - mysql_async::conn::pool::Exchange::spawn_futures_if_needed::h7b820e5753962bfb
                               at /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_async-0.25.0/src/conn/pool/mod.rs:79:13
  19:        0x10ee458e6 - mysql_async::conn::pool::Pool::poll_new_conn_inner::h80344d2cc2281d13
                               at /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_async-0.25.0/src/conn/pool/mod.rs:236:9
  20:        0x10ee4568c - mysql_async::conn::pool::Pool::poll_new_conn::h3266b761607811a0
                               at /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_async-0.25.0/src/conn/pool/mod.rs:223:9
  21:        0x10ee7efa2 - <mysql_async::conn::pool::futures::get_conn::GetConn as core::future::future::Future>::poll::hab19b271f37ed892
                               at /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_async-0.25.0/src/conn/pool/futures/get_conn.rs:77:51
@rohitjoshi
Copy link
Author

I believe issue is due to application using tokio-0.3.3 but mysql_async relies on tokio-2.17

@rohitjoshi rohitjoshi changed the title Panic while getting connection from pool Panic while getting connection from pool (support for tokio-0.3?) Nov 3, 2020
@blackbeam
Copy link
Owner

Hi.

Looks like an update to tokio-0.3.3 is blocked by tokio-rs/tokio#2965.
We have to wait for tokio-rs/tokio#3076.

@rohitjoshi
Copy link
Author

@blackbeam thank you. tokio-rs/tokio#3076 is merged.

@rohitjoshi
Copy link
Author

Any plan to release a version to support tokio-0.3.4?

thread 'xxx-xx' panicked at 'must be called from the context of Tokio runtime configured with either basic_scheduler or threaded_scheduler', /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.23/src/task/spawn.rs:131:10

@blackbeam
Copy link
Owner

@rohitjoshi, it'll be in #138, but still blocked by tokio-rs/tokio#3118.
If you're targetting UNIX, then for now I'd suggest you use the tokio3 branch as a dependency

@rohitjoshi
Copy link
Author

@blackbeam thanks. I will use tokio3 branch for now.

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

2 participants