AlexPikalov / cdrs

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Apache License 2.0
342 stars 58 forks source link

General("Timed out in bb8") #342

Closed fggarcia closed 2 years ago

fggarcia commented 4 years ago

after doubling the traffic, our application in the production environment started throwing the following error

General ("Timed out in bb8")

our session configuration:

async fn create_db_session (config: & DBConfig) -> std :: result :: Result <CurrentSession, AppError> {
    let auth = StaticPasswordAuthenticator :: new (& config.user, & config.password);

    let nodes_ip_port = get_nodes_ip (config);

    let mut nodes = Vec :: with_capacity (config.hosts.len ());
    for node_ip_port in nodes_ip_port.iter () {
        let node_config = NodeTcpConfigBuilder :: new (node_ip_port.as_str (), auth.clone ())
            .max_size (config.driver.max_connection)
            .min_idle (config.driver.min_idle)
            .max_lifetime (config.driver.max_lifetime (Duration :: from_secs))
            .idle_timeout (config.driver.idle_timeout.map (Duration :: from_secs))
            .build ();
        nodes.push (node_config);
    }

    let cluster_config = ClusterTcpConfig (nodes);
    let session = new_lz4_session (& cluster_config, RoundRobin :: new ());
    Ok (session.await?)
}

Do you have any suggestion?

maybe related to https://github.com/khuey/bb8/issues/67 ??

AlexPikalov commented 4 years ago

It is very likely those are related issues. Let's see what would be a fix from bb8. I'm afraid this is the only one think we as bb8 consumers can do now.

fggarcia commented 4 years ago

Hi @AlexPikalov thanks you so much for your response.

Okey.....wait for a fix from bb8.

Close issue.

AlexPikalov commented 4 years ago

I'd prefer to keep it opened for tracking purposes

fggarcia commented 4 years ago

Hi @AlexPikalov maybe is preferable to switch to a new connector manager as https://github.com/mozilla-services/syncstorage-rs/issues/794 do. is it possible?? i don't see progress in bb8