I am using clickhouse-rs in a gui application. It works as expected until I try to close the program. When I do, I get an exception for each ClientHandle that was created:
Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.
I reviewed the stack trace and with some web search found that this issue has happened before with other crates. First the relevant part of the stack trace (full stack trace at the bottom):
13: 0x562f0dc6cc89 - std::panicking::begin_panic::ha46902d46371d310
at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:541:12
14: 0x562f0dc0e43f - tokio::runtime::blocking::shutdown::Receiver::wait::h936f598116b25343
at /home/mks/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.12.0/src/runtime/blocking/shutdown.rs:51:21
15: 0x562f0dbea27a - tokio::runtime::blocking::pool::BlockingPool::shutdown::h8ff67935fe502e92
at /home/mks/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.12.0/src/runtime/blocking/pool.rs:145:12
I am using clickhouse-rs in a gui application. It works as expected until I try to close the program. When I do, I get an exception for each ClientHandle that was created:
Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.
I reviewed the stack trace and with some web search found that this issue has happened before with other crates. First the relevant part of the stack trace (full stack trace at the bottom):
This Rocket issue has a stack trace with identical part as quoted and it seems to me it is the same problem as the one I am experiencing: https://github.com/SergioBenitez/Rocket/issues/1466 . This comment in particular should be helpful: https://github.com/SergioBenitez/Rocket/issues/1466#issuecomment-722008413
My Cargo.toml has this:
clickhouse-rs = { git = "https://github.com/suharev7/clickhouse-rs" }
Full Stack Trace: