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

websocket client error about tokio #213

Closed
Andy320 opened this issue Dec 20, 2019 · 4 comments · Fixed by #166
Closed

websocket client error about tokio #213

Andy320 opened this issue Dec 20, 2019 · 4 comments · Fixed by #166

Comments

@Andy320
Copy link

Andy320 commented Dec 20, 2019

After a successful building...

$ target/debug/websocket-server
2019-12-20T07:23:21Z INFO actix_server::builder] Starting 4 workers
[2019-12-20T07:23:21Z INFO actix_server::builder] Starting server on 127.0.0.1:8080

HttpRequest HTTP/1.1 GET:/ws/
headers:
"sec-websocket-version": "13"
"upgrade": "websocket"
"host": "127.0.0.1"
"date": "Fri, 20 Dec 2019 07:23:42 GMT"
"sec-websocket-key": "WooAi1Tj/UX/JUbar8hI4w=="
"connection": "upgrade"

Ok(
Response HTTP/1.1 101 Switching Protocols
headers:
"upgrade": "websocket"
"sec-websocket-accept": "xrTk+NMx5mtLFlHB0En2jEduwMU="
"transfer-encoding": "chunked"
body: Stream
)
[2019-12-20T07:23:42Z INFO actix_web::middleware::logger] 127.0.0.1:56956 "GET /ws/ HTTP/1.1" 101 0 "-" "-" 0.036748

$ target/debug/websocket-client
ClientResponse HTTP/1.1 101 Switching Protocols
headers:
"date": "Fri, 20 Dec 2019 07:23:42 GMT"
"upgrade": "websocket"
"connection": "upgrade"
"sec-websocket-accept": "xrTk+NMx5mtLFlHB0En2jEduwMU="
"transfer-encoding": "chunked"

thread 'main' panicked at 'no current timer', /Users/wenjunwang/.cargo/registry/src/code.aliyun.com-738b7dba08a2a41e/tokio-0.2.4/src/time/driver/handle.rs:67:21
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

@Andy320
Copy link
Author

Andy320 commented Dec 21, 2019

git pull the latest code and rerun the case, got the same error.
Paste the output details here,

stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:77
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:61
4: core::fmt::write
at src/libcore/fmt/mod.rs:1028
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1412
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:65
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:50
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:188
9: std::panicking::default_hook
at src/libstd/panicking.rs:205
10: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:464
11: tokio::util::slab::page::Shared::alloc_page
12: tokio::time::driver::handle::Handle::current::{{closure}}
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/driver/handle.rs:67
13: std::thread::local::LocalKey::try_with
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/thread/local.rs:262
14: std::thread::local::LocalKey::with
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/thread/local.rs:239
15: tokio::time::driver::handle::Handle::current
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/driver/handle.rs:65
16: tokio::time::driver::entry::Entry::new
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/driver/entry.rs:108
17: tokio::time::driver::registration::Registration::new
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/driver/registration.rs:19
18: tokio::time::delay::delay_until
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/delay.rs:19
19: tokio::time::delay::delay_for
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/time/delay.rs:37
20: actix::utils::TimerFunc::new
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-0.9.0/src/utils.rs:102
21: actix::actor::AsyncContext::run_later
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-0.9.0/src/actor.rs:453
22: websocket_client::ChatClient::hb
at websocket/src/client.rs:80
23: <websocket_client::ChatClient as actix::actor::Actor>::started
at websocket/src/client.rs:64
24: <actix::contextimpl::ContextFut<A,C> as core::future::future::Future>::poll
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-0.9.0/src/contextimpl.rs:348
25: <actix::contextimpl::ContextFut<A,C> as core::ops::drop::Drop>::drop
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-0.9.0/src/contextimpl.rs:228
26: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
27: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
28: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
29: tokio::task::core::Core::transition_to_consumed
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/core.rs:106
30: tokio::task::harness::Harness<T,S>::do_cancel::{{closure}}::{{closure}}
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/harness.rs:363
31: core::ops::function::FnOnce::call_once
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ops/function.rs:227
32: <std::panic::AssertUnwindSafe as core::ops::function::FnOnce<()>>::call_once
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/panic.rs:317
33: std::panicking::try::do_call
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/panicking.rs:287
34: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:78
35: std::panicking::try
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/panicking.rs:265
36: std::panic::catch_unwind
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/panic.rs:396
37: tokio::task::harness::Harness<T,S>::do_cancel::{{closure}}
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/harness.rs:361
38: tokio::loom::std::causal_cell::CausalCell::with_mut
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/loom/std/causal_cell.rs:41
39: tokio::task::harness::Harness<T,S>::do_cancel
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/harness.rs:359
40: tokio::task::harness::Harness<T,S>::cancel
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/harness.rs:342
41: tokio::task::raw::cancel
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/raw.rs:196
42: tokio::task::raw::RawTask::cancel_from_queue
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/raw.rs:145
43: tokio::task::Task::shutdown
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/mod.rs:385
44: tokio::task::queue::MpscQueues::close_local
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/queue.rs:287
45: tokio::task::queue::MpscQueues::shutdown
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/queue.rs:227
46: <tokio::task::local::Scheduler as core::ops::drop::Drop>::drop
at /Users/wenjunwang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.6/src/task/local.rs:435
47: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
48: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
49: core::ptr::drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:165
50: <alloc::rc::Rc as core::ops::drop::Drop>::drop
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/liballoc/rc.rs:1101
51: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
52: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
53: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
54: core::ptr::real_drop_in_place
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/ptr/mod.rs:175
55: websocket_client::main
at websocket/src/client.rs:16
56: std::rt::lang_start::{{closure}}
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/rt.rs:61
57: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:48
58: std::panicking::try::do_call
at src/libstd/panicking.rs:287
59: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:78
60: std::panicking::try
at src/libstd/panicking.rs:265
61: std::panic::catch_unwind
at src/libstd/panic.rs:396
62: std::rt::lang_start_internal
at src/libstd/rt.rs:47
63: std::rt::lang_start
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/rt.rs:61
64: websocket_client::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

@fMeow
Copy link
Member

fMeow commented Dec 22, 2019

I have encounter the same 'no current timer' error, and have found a workaround if not fix. The updated PR #166 contains my workaround and plus a simplification for websocket-client. You can have a look at my workaround before this PR merged.

@Andy320
Copy link
Author

Andy320 commented Dec 23, 2019

@guoli-lyu
yes, it works fine. thank you.

@Igosuki
Copy link

Igosuki commented Dec 23, 2019

But my question would be why is this error popping up ?

rtyler added a commit to rtyler/otto that referenced this issue Jan 5, 2020
This fails with a "no current timer" panic

Referenced: actix/examples#213

Potentially fixed with: actix/examples#166
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

Successfully merging a pull request may close this issue.

3 participants