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

Fix possible panic in case broken protocol #208

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

azat
Copy link
Contributor

@azat azat commented Dec 24, 2023

stacktrace:

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/io/transport.rs:122:31

   8: core::option::Option<T>::unwrap
             at /rustc/0ab38e95bb1cbf0bd038d359bdecbfa501f003a7/library/core/src/option.rs:935:21
   9: clickhouse_rs::io::transport::ClickhouseTransport::clear::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/io/transport.rs:122:29
  10: clickhouse_rs::ClientHandle::ping::{{closure}}::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:340:59
  11: <tokio::time::timeout::Timeout<T> as core::future::future::Future>::poll
             at /home/azat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/time/timeout.rs:202:33
  12: clickhouse_rs::with_timeout::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:641:43
  13: clickhouse_rs::ClientHandle::ping::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:365:10
  14: clickhouse_rs::retry_guard::check::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/retry_guard.rs:57:14
  15: clickhouse_rs::retry_guard::retry_guard::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/retry_guard.rs:21:33
  16: clickhouse_rs::ClientHandle::check_connection::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:586:78
  17: clickhouse_rs::ClientHandle::wrap_stream::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:555:89
  ...
  26: clickhouse_rs::with_timeout::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:641:43
  27: clickhouse_rs::types::query_result::QueryResult::fetch_all::{{closure}}
             at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/types/query_result/mod.rs:47:10

stacktrace:

    thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/io/transport.rs:122:31

       8: core::option::Option<T>::unwrap
                 at /rustc/0ab38e95bb1cbf0bd038d359bdecbfa501f003a7/library/core/src/option.rs:935:21
       9: clickhouse_rs::io::transport::ClickhouseTransport::clear::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/io/transport.rs:122:29
      10: clickhouse_rs::ClientHandle::ping::{{closure}}::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:340:59
      11: <tokio::time::timeout::Timeout<T> as core::future::future::Future>::poll
                 at /home/azat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/time/timeout.rs:202:33
      12: clickhouse_rs::with_timeout::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:641:43
      13: clickhouse_rs::ClientHandle::ping::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:365:10
      14: clickhouse_rs::retry_guard::check::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/retry_guard.rs:57:14
      15: clickhouse_rs::retry_guard::retry_guard::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/retry_guard.rs:21:33
      16: clickhouse_rs::ClientHandle::check_connection::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:586:78
      17: clickhouse_rs::ClientHandle::wrap_stream::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:555:89
      ...
      26: clickhouse_rs::with_timeout::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/lib.rs:641:43
      27: clickhouse_rs::types::query_result::QueryResult::fetch_all::{{closure}}
                 at /home/azat/.cargo/git/checkouts/clickhouse-rs-37da3cb97e01332d/afd8ce5/src/types/query_result/mod.rs:47:10
@azat
Copy link
Contributor Author

azat commented Mar 31, 2024

@suharev7 can you take a look please?

@suharev7 suharev7 merged commit e47ba33 into suharev7:async-await Mar 31, 2024
1 check passed
@suharev7
Copy link
Owner

Thanks

@azat azat deleted the fix-panic branch March 31, 2024 15:49
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 this pull request may close these issues.

2 participants