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

runtime feature is not additive #2595

Closed
JakkuSakura opened this issue Jul 11, 2021 · 1 comment
Closed

runtime feature is not additive #2595

JakkuSakura opened this issue Jul 11, 2021 · 1 comment
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@JakkuSakura
Copy link

Version
0.14.0

Platform
Linux jack-pc 5.10.42-1-MANJARO #1 SMP PREEMPT Thu Jun 3 14:37:11 UTC 2021 x86_64 GNU/Linux

Description
I'm using hyper in custom network stack and executors. I just got it running. However, I found runtime feature is not additive.
Since I'm not using tokio, with runtime feature enabled may cause a panic when shuting dow.

I can simply not enable runtime feature, but other crates like reqwest enables it and breaks my code.

backtrace
Jul 12 01:06:13.296 ERROR main panic: thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime': /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/runtime/context.rs:37
   0: log_panics::init::{{closure}}
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/log-panics-2.0.0/src/lib.rs:52:25
   1: std::panicking::rust_panic_with_hook
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:626:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:519:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/sys_common/backtrace.rs:141:18
   4: rust_begin_unwind
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:515:5
   5: core::panicking::panic_fmt
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/panicking.rs:92:14
   6: core::option::expect_failed
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/option.rs:1243:5
   7: core::option::Option<T>::expect
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/option.rs:351:21
   8: tokio::runtime::context::time_handle::{{closure}}
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/runtime/context.rs:37:13
   9: std::thread::local::LocalKey<T>::try_with
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/thread/local.rs:399:16
  10: std::thread::local::LocalKey<T>::with
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/thread/local.rs:375:9
  11: tokio::runtime::context::time_handle
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/runtime/context.rs:35:9
  12: tokio::time::driver::handle::Handle::current
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/time/driver/handle.rs:54:13
  13: tokio::time::driver::sleep::Sleep::new_timeout
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/time/driver/sleep.rs:171:22
  14: tokio::time::driver::sleep::sleep_until
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/time/driver/sleep.rs:22:5
  15: tokio::time::interval::interval_at
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/time/interval.rs:110:25
  16: tokio::time::interval::interval
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.8.1/src/time/interval.rs:74:5
  17: hyper::client::pool::PoolInner<T>::spawn_idle_interval
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.10/src/client/pool.rs:418:23
  18: hyper::client::pool::PoolInner<T>::put
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.10/src/client/pool.rs:383:21
  19: <hyper::client::pool::Pooled<T> as core::ops::drop::Drop>::drop
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.10/src/client/pool.rs:533:21
  20: core::ptr::drop_in_place<hyper::client::pool::Pooled<hyper::client::client::PoolClient<hyper::body::body::Body>>>
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ptr/mod.rs:192:1
  21: core::ptr::drop_in_place<hyper::client::client::Client<devourer::network::common::http::HyperBuilderAdaptor<devourer::network::common::logging_channel::LoggingChannelBuilder<devourer::network::host::tcp_channel::HostTcpChannelBuilder>>>::send_request::{{closure}}::{{closure}}>
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ptr/mod.rs:192:1
  22: core::ptr::drop_in_place<futures_util::future::poll_fn::PollFn<hyper::client::client::Client<devourer::network::common::http::HyperBuilderAdaptor<devourer::network::common::logging_channel::LoggingChannelBuilder<devourer::network::host::tcp_channel::HostTcpChannelBuilder>>>::send_request::{{closure}}::{{closure}}>>
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ptr/mod.rs:192:1
  23: <pin_project_lite::__private::UnsafeDropInPlaceGuard<T> as core::ops::drop::Drop>::drop
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-lite-0.2.7/src/lib.rs:1800:17
  24: core::ptr::drop_in_place<pin_project_lite::__private::UnsafeDropInPlaceGuard<futures_util::future::poll_fn::PollFn<hyper::client::client::Client<devourer::network::common::http::HyperBuilderAdaptor<devourer::network::common::logging_channel::LoggingChannelBuilder<devourer::network::host::tcp_channel::HostTcpChannelBuilder>>>::send_request::{{closure}}::{{closure}}>>>
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ptr/mod.rs:192:1
  25: core::ptr::drop_in_place<(pin_project_lite::__private::UnsafeDropInPlaceGuard<futures_util::future::poll_fn::PollFn<hyper::client::client::Client<devourer::network::common::http::HyperBuilderAdaptor<devourer::network::common::logging_channel::LoggingChannelBuilder<devourer::network::host::tcp_channel::HostTcpChannelBuilder>>>::send_request::{{closure}}::{{closure}}>>,())>
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ptr/mod.rs:192:1
  26: futures_util::future::future::map::_::<impl futures_util::future::future::map::Map<Fut,F>>::project_replace
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/pin-project-lite-0.2.7/src/lib.rs:1131:29
  27: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.15/src/future/future/map.rs:56:23
  28: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.15/src/lib.rs:93:13
  29: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/future/future.rs:119:9
  30: <futures_task::future_obj::LocalFutureObj<T> as core::future::future::Future>::poll
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-task-0.3.15/src/future_obj.rs:84:18
  31: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.15/src/stream/futures_unordered/mod.rs:521:17
  32: futures_util::stream::stream::StreamExt::poll_next_unpin
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.15/src/stream/stream/mod.rs:1416:9
  33: minimal_executor::local_pool::LocalPool<Ret>::poll_once::{{closure}}
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:167:13
  34: minimal_executor::local_pool::poll_fn
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:12:5
  35: minimal_executor::local_pool::LocalPool<Ret>::poll_once
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:163:9
  36: <devourer::network::common::http::HttpClient<devourer::network::common::http::HyperBuilderAdaptor<Builder>> as futures_io::if_std::AsyncRead>::poll_read
             at devourer/src/network/common/http.rs:174:17
  37: <&mut T as futures_io::if_std::AsyncRead>::poll_read
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-io-0.3.15/src/lib.rs:337:17
  38: <futures_util::io::read::Read<R> as core::future::future::Future>::poll
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.15/src/io/read.rs:28:9
  39: http_example::main::{{closure}}
             at devourer/examples/http_example.rs:18:20
  40: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/future/mod.rs:80:19
  41: minimal_executor::local_pool::block_on::{{closure}}
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:33:19
  42: minimal_executor::local_pool::block_fn
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:19:33
  43: minimal_executor::local_pool::block_on
             at /home/jack/.cargo/registry/src/github.com-1ecc6299db9ec823/minimal-executor-0.1.7/src/local_pool.rs:33:5
  44: http_example::main
             at devourer/examples/http_example.rs:9:5
  45: core::ops::function::FnOnce::call_once
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ops/function.rs:227:5
  46: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/sys_common/backtrace.rs:125:18
  47: std::rt::lang_start::{{closure}}
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/rt.rs:63:18
  48: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:401:40
      std::panicking::try
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:365:19
      std::panic::catch_unwind
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panic.rs:434:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/rt.rs:45:48
      std::panicking::try::do_call
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:401:40
      std::panicking::try
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panicking.rs:365:19
      std::panic::catch_unwind
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/panic.rs:434:14
      std::rt::lang_start_internal
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/rt.rs:45:20
  49: std::rt::lang_start
             at /rustc/e6b4c252ea33e9f80ab8b8d7b3f6393e54166127/library/std/src/rt.rs:62:5
  50: main
  51: __libc_start_main
  52: _start
    
Jul 12 01:06:13.298 TRACE main want: signal: Closed    

Process finished with exit code 101

@JakkuSakura JakkuSakura added the C-bug Category: bug. Something is wrong. This is bad! label Jul 11, 2021
@seanmonstar
Copy link
Member

Tracking this in #2857

@seanmonstar seanmonstar closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

2 participants