Commit 2fee444a authored by jan.koester's avatar jan.koester
Browse files

test

parent bd8a330f
Loading
Loading
Loading
Loading
Loading
+14 −0
Changes for src/cluster.cpp: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -429,6 +429,14 @@ namespace authdb {
    void Cluster::start() {
        if (running_) return;
        running_ = true;

        // Warm up session_client_ dead_until cache so first request doesn't block
        if (session_client_) {
            try {
                session_client_->get_cluster_status();
            } catch (...) {}
        }

        server_thread_ = std::thread(&Cluster::server_loop, this);
        health_monitor_thread_ = std::thread(&Cluster::health_monitor_loop, this);
        push_worker_thread_ = std::thread(&Cluster::push_worker_loop, this);
@@ -527,6 +535,12 @@ namespace authdb {
            if (!running_ || !pclient_) continue;
            try {
                auto health = pclient_->get_cluster_status();

                // Keep session_client_ dead_until cache warm
                if (session_client_) {
                    try { session_client_->get_cluster_status(); } catch (...) {}
                }

                bool was_degraded = degraded_;
                bool was_critical = critical_;
                if (health.nodes_online >= n) {