suharev7 / clickhouse-rs

Asynchronous ClickHouse client library for Rust programming language.
MIT License
324 stars 121 forks source link

Some time panic Option::unwrap() when clickhouse restarts #200

Closed igorivaniuk closed 1 year ago

igorivaniuk commented 1 year ago

v 1.1.0-alpha.1 When clickhouse server restarts, getting panics.

thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value', src/types/query_result/mod.rs:94:44

Same for insert queries

In all places are some like

let transport = c.inner.take().unwrap();
igorivaniuk commented 1 year ago

Found that there no pong message

2023-10-04T14:51:05.019627Z  INFO clickhouse_rs: [ping]    
2023-10-04T14:51:05.019808Z  INFO clickhouse_rs::types::query_result: [send query] select .................... 
thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value', src/types/query_result/mod.rs:94:44

Usual there are pong response

2023-10-04T14:42:48.402376Z  INFO clickhouse_rs: [ping]    
2023-10-04T14:42:48.402662Z  INFO clickhouse_rs: [pong]    
2023-10-04T14:42:48.402688Z  INFO clickhouse_rs::types::query_result: [send query] select ..........
amitassaraf commented 1 year ago

Happens to me too

suharev7 commented 1 year ago

I've pushed a fix for this big.

igorivaniuk commented 1 year ago

Thank you. I checked it works