hyperium / hyperium/hyper

panicked at dispatch dropped without returning error

Open
#2,892 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Hi there, thanks for your awesome work

Version

name = "hyper"
version = "0.14.19"

Platform
Screen Shot 2022-06-11 at 9 32 18 PM

Description

I use wiremock which underlines use hyper, I started to write tests but faced next flaky error

---- github_provider::tests::create_source_tree::success stdout ----
thread 'github_provider::tests::create_source_tree::success' panicked at 'dispatch dropped without returning error', /Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/conn.rs:329:35

Running with backtrace=1

  0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::panicking::assert_failed_inner
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:188:17
   3: core::panicking::assert_failed
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:145:5
   4: syncy::github_provider::tests::create_source_tree::success::{{closure}}
             at ./src/github_provider.rs:646:13
   5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
   6: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/future.rs:119:9
   7: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:507:48
   8: tokio::coop::with_budget::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:102:9
   9: std::thread::local::LocalKey<T>::try_with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:399:16
  10: std::thread::local::LocalKey<T>::with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:375:9
  11: tokio::coop::with_budget
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:95:5
  12: tokio::coop::budget
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:72:5
  13: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:507:25
  14: tokio::runtime::basic_scheduler::Context::enter
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:361:19
  15: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:506:36
  16: tokio::runtime::basic_scheduler::CoreGuard::enter::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:564:57
  17: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/macros/scoped_tls.rs:61:9
  18: tokio::runtime::basic_scheduler::CoreGuard::enter
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:564:27
  19: tokio::runtime::basic_scheduler::CoreGuard::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:497:9
  20: tokio::runtime::basic_scheduler::BasicScheduler::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:173:24
  21: tokio::runtime::Runtime::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/mod.rs:475:46
  22: syncy::github_provider::tests::create_source_tree::success
             at ./src/github_provider.rs:648:13
  23: syncy::github_provider::tests::create_source_tree::success::{{closure}}
             at ./src/github_provider.rs:569:15
  24: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
  25: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- github_provider::tests::create_source_tree::complex_case stdout ----
thread 'github_provider::tests::create_source_tree::complex_case' panicked at 'dispatch dropped without returning error', /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/conn.rs:329:35
stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:525:12
   1: hyper::client::conn::SendRequest<B>::send_request_retryable::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/conn.rs:329:35
   2: <T as futures_util::fns::FnOnce1<A>>::call_once
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/fns.rs:15:9
   3: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/future/map.rs:57:73
   4: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
   5: <futures_util::future::future::flatten::Flatten<Fut,<Fut as core::future::future::Future>::Output> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/future/flatten.rs:50:36
   6: <futures_util::future::future::Then<Fut1,Fut2,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
   7: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/either.rs:89:32
   8: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/either.rs:89:32
   9: <F as futures_core::future::TryFuture>::try_poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.21/src/future.rs:82:9
  10: <futures_util::future::try_future::into_future::IntoFuture<Fut> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/try_future/into_future.rs:34:9
  11: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/future/map.rs:55:37
  12: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  13: <futures_util::future::try_future::MapErr<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  14: <F as futures_core::future::TryFuture>::try_poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.21/src/future.rs:82:9
  15: <futures_util::future::try_future::into_future::IntoFuture<Fut> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/try_future/into_future.rs:34:9
  16: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/future/map.rs:55:37
  17: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  18: <futures_util::future::try_future::MapOk<Fut,F> as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  19: hyper::client::client::Client<C,B>::send_request::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/client.rs:300:23
  20: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  21: hyper::client::client::Client<C,B>::retryably_send_request::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/client.rs:200:25
  22: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  23: <hyper::client::client::ResponseFuture as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.19/src/client/client.rs:611:9
  24: <reqwest::async_impl::client::PendingRequest as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.10/src/async_impl/client.rs:1780:29
  25: <reqwest::async_impl::client::Pending as core::future::future::Future>::poll
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.10/src/async_impl/client.rs:1759:51
  26: octocrab::Octocrab::execute::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/octocrab-0.15.4/src/lib.rs:831:26
  27: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  28: octocrab::Octocrab::_get::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/octocrab-0.15.4/src/lib.rs:664:9
  29: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  30: octocrab::Octocrab::get::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/octocrab-0.15.4/src/lib.rs:648:24
  31: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  32: octocrab::api::repos::file::GetContentBuilder::send::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/octocrab-0.15.4/src/api/repos/file.rs:44:9
  33: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  34: syncy::github_provider::get_repo::{{closure}}
             at ./src/github_provider.rs:291:5
  35: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  36: syncy::github_provider::unwrap_file::{{closure}}
             at ./src/github_provider.rs:252:25
  37: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  38: syncy::github_provider::fill_tree_with_nodes::{{closure}}
             at ./src/github_provider.rs:233:21
  39: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  40: syncy::github_provider::unwrap_folder::{{closure}}
             at ./src/github_provider.rs:281:5
  41: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  42: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/future.rs:119:9
  43: syncy::github_provider::fill_tree_with_nodes::{{closure}}
             at ./src/github_provider.rs:235:21
  44: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  45: <syncy::github_provider::GithubProvider as syncy::provider::Provider<alloc::sync::Arc<octocrab::Octocrab>>>::create_source_tree::{{closure}}
             at ./src/github_provider.rs:57:9
  46: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  47: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/future.rs:119:9
  48: syncy::github_provider::tests::create_source_tree::complex_case::{{closure}}
             at ./src/github_provider.rs:734:31
  49: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  50: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/future.rs:119:9
  51: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:507:48
  52: tokio::coop::with_budget::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:102:9
  53: std::thread::local::LocalKey<T>::try_with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:399:16
  54: std::thread::local::LocalKey<T>::with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:375:9
  55: tokio::coop::with_budget
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:95:5
  56: tokio::coop::budget
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/coop.rs:72:5
  57: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:507:25
  58: tokio::runtime::basic_scheduler::Context::enter
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:361:19
  59: tokio::runtime::basic_scheduler::CoreGuard::block_on::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:506:36
  60: tokio::runtime::basic_scheduler::CoreGuard::enter::{{closure}}
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:564:57
  61: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/macros/scoped_tls.rs:61:9
  62: tokio::runtime::basic_scheduler::CoreGuard::enter
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:564:27
  63: tokio::runtime::basic_scheduler::CoreGuard::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:497:9
  64: tokio::runtime::basic_scheduler::BasicScheduler::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/basic_scheduler.rs:173:24
  65: tokio::runtime::Runtime::block_on
             at /Users/andreyfrolov/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.18.2/src/runtime/mod.rs:475:46
  66: syncy::github_provider::tests::create_source_tree::complex_case
             at ./src/github_provider.rs:758:13
  67: syncy::github_provider::tests::create_source_tree::complex_case::{{closure}}
             at ./src/github_provider.rs:652:15
  68: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
  69: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

[short summary of the bug]

Here's the reproduction repo with an actual bug, just run the tests:

https://github.com/frolovdev/syncy

[code sample that causes the bug]

github_provider.rs

tests if run them in parallel (more than 1 thread)

I expected to see this happen: tests passed

Instead, this happened: sometimes it works, sometimes not

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with hyper 0.14.19's client/conn.rs at line 329 and follow the request path through client.rs shown in the backtrace. Reproduce the flaky failures from src/github_provider.rs around lines 646-648; done means the dispatch failure is handled without the reported panic and the request returns an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.