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

Fail to create redis pool with tokio 0.2 and nightly rust #42

Closed
EMayej opened this issue Nov 15, 2019 · 1 comment
Closed

Fail to create redis pool with tokio 0.2 and nightly rust #42

EMayej opened this issue Nov 15, 2019 · 1 comment

Comments

@EMayej
Copy link

EMayej commented Nov 15, 2019

My environment:
code repository: https://github.com/EMayej/rs-bb8-redis
rust version: rustc 1.40.0-nightly (2477e2493 2019-11-04)

I tried to use bb8 with tokio 0.2, when I run the program, it reports

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SpawnError { is_shutdown: true }', src/libcore/result.rs:1165:5

Below is the output of env RUST_BACKTRACE=full cargo run, it looks like stack 16 and 17 trigger the panic:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SpawnError { is_shutdown: true }', src/libcore/result.rs:1165:5
stack backtrace:
   0:        0x109205e45 - backtrace::backtrace::libunwind::trace::h8f761892b88f7dc8
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:        0x109205e45 - backtrace::backtrace::trace_unsynchronized::he51ab0165d85becb
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:        0x109205e45 - std::sys_common::backtrace::_print_fmt::hadaad98187d7cb07
                               at src/libstd/sys_common/backtrace.rs:77
   3:        0x109205e45 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3c5a272958cd5a04
                               at src/libstd/sys_common/backtrace.rs:61
   4:        0x109220830 - core::fmt::write::hd88fffaf4bc6db48
                               at src/libcore/fmt/mod.rs:1028
   5:        0x109202f1b - std::io::Write::write_fmt::hce06fb5a3353c591
                               at src/libstd/io/mod.rs:1412
   6:        0x109207b83 - std::sys_common::backtrace::_print::h8eacc794e79f0359
                               at src/libstd/sys_common/backtrace.rs:65
   7:        0x109207b83 - std::sys_common::backtrace::print::h969a7cf78dc7e1fd
                               at src/libstd/sys_common/backtrace.rs:50
   8:        0x109207b83 - std::panicking::default_hook::{{closure}}::h847a58d309a7cea4
                               at src/libstd/panicking.rs:188
   9:        0x10920788a - std::panicking::default_hook::h0715616d08c05b60
                               at src/libstd/panicking.rs:205
  10:        0x1092082cb - std::panicking::rust_panic_with_hook::hc7409c536d0d6111
                               at src/libstd/panicking.rs:464
  11:        0x109207e29 - std::panicking::continue_panic_fmt::h2f41864899758f23
                               at src/libstd/panicking.rs:373
  12:        0x109207d29 - rust_begin_unwind
                               at src/libstd/panicking.rs:302
  13:        0x10921ddbc - core::panicking::panic_fmt::hb54121e5882c537a
                               at src/libcore/panicking.rs:139
  14:        0x10921de99 - core::result::unwrap_failed::h0591d7542260370e
                               at src/libcore/result.rs:1165
  15:        0x108f5b05a - core::result::Result<T,E>::unwrap::h733a06e0fd4fa49f
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libcore/result.rs:933
  16:        0x108f4b331 - tokio_executor::global::spawn::hf155d52fa6070f70
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:165
  17:        0x108f4717c - bb8::Pool<M>::new_inner::hfcbe7c2a5fd92ff2
                               at /Users/EMayej/.cargo/git/checkouts/bb8-176170de965f79ee/0639389/src/lib.rs:664
  18:        0x108f4815f - bb8::Builder<M>::build_inner::hca668ca11028a991
                               at /Users/EMayej/.cargo/git/checkouts/bb8-176170de965f79ee/0639389/src/lib.rs:303
  19:        0x108f4830f - bb8::Builder<M>::build::hdbb6f0f1f6320636
                               at /Users/EMayej/.cargo/git/checkouts/bb8-176170de965f79ee/0639389/src/lib.rs:313
  20:        0x108f569e6 - rs_bb8_redis::main::{{closure}}::h26a0c37b0ce9128c
                               at src/main.rs:8
  21:        0x108f60ccf - <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}}::hbab42c1f4be7221b
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/future.rs:43
  22:        0x108f60b37 - std::future::set_task_context::he6fbccfce8487124
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/future.rs:79
  23:        0x108f60c94 - <std::future::GenFuture<T> as core::future::future::Future>::poll::hcab46014fa3e0aa6
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/future.rs:43
  24:        0x108f55b52 - tokio_executor::enter::Enter::block_on::h6a3e2db7777c96d8
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.2.0-alpha.6/src/enter.rs:118
  25:        0x108f4ae7b - tokio::runtime::threadpool::Runtime::block_on::{{closure}}::{{closure}}::h6d1a9e179b7dbcd8
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.0-alpha.6/src/runtime/threadpool/mod.rs:178
  26:        0x108f613c1 - tracing_core::dispatcher::with_default::hf64f07a03cb40aee
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-core-0.1.7/src/dispatcher.rs:226
  27:        0x108f4ad52 - tokio::runtime::threadpool::Runtime::block_on::{{closure}}::hce02d37d9193b599
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.0-alpha.6/src/runtime/threadpool/mod.rs:177
  28:        0x108f5735d - tokio_executor::global::with_default::{{closure}}::h309ebf8d3174d7eb
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.2.0-alpha.6/src/global.rs:173
  29:        0x108f5cdff - std::thread::local::LocalKey<T>::try_with::h212b5914e2ac2f47
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/thread/local.rs:262
  30:        0x108f5cc28 - std::thread::local::LocalKey<T>::with::he0eef222b3d0f0d1
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/thread/local.rs:239
  31:        0x108f571c8 - tokio_executor::global::with_default::h8f93a710e16368ec
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.2.0-alpha.6/src/global.rs:147
  32:        0x108f4abeb - tokio::runtime::threadpool::Runtime::block_on::h948ab96b64ca55a4
                               at /Users/EMayej/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.0-alpha.6/src/runtime/threadpool/mod.rs:174
  33:        0x108f4cfd6 - rs_bb8_redis::main::h0119947bfd362297
                               at src/main.rs:4
  34:        0x108f6c882 - std::rt::lang_start::{{closure}}::haafd5f87b1839333
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/rt.rs:61
  35:        0x109207ca8 - std::rt::lang_start_internal::{{closure}}::h59ed7b0d82d79ae9
                               at src/libstd/rt.rs:48
  36:        0x109207ca8 - std::panicking::try::do_call::h8bf384ff55799751
                               at src/libstd/panicking.rs:287
  37:        0x10920ab8f - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:78
  38:        0x10920865e - std::panicking::try::h31172b278baba0d3
                               at src/libstd/panicking.rs:265
  39:        0x10920865e - std::panic::catch_unwind::h4c69a67a533516a8
                               at src/libstd/panic.rs:396
  40:        0x10920865e - std::rt::lang_start_internal::h8b637dc44c57cd2d
                               at src/libstd/rt.rs:47
  41:        0x108f6c862 - std::rt::lang_start::h786ea050cfbeb1f9
                               at /rustc/2477e2493e67527fc282c7239e019f7ebd513a1a/src/libstd/rt.rs:61
  42:        0x108f4d042 - rs_bb8_redis::main::h0119947bfd362297

Is this because tokio-executor 0.1.8 (stack 16) is been used? How could I correctly use them (tokio 0.2 and bbs) together? Does this relate to #31?

Thank you.

@khuey
Copy link
Collaborator

khuey commented Nov 15, 2019

Yeah, you can't use this library with tokio 0.2 yet.

Closing as a duplicate of #31.

@khuey khuey closed this as completed Nov 15, 2019
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