suharev7 / clickhouse-rs

Asynchronous ClickHouse client library for Rust programming language.
MIT License
322 stars 119 forks source link

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

Closed igorivaniuk closed 11 months ago

igorivaniuk commented 11 months 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 11 months 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 11 months ago

Happens to me too

suharev7 commented 11 months ago

I've pushed a fix for this big.

igorivaniuk commented 11 months ago

Thank you. I checked it works