Commit bed152c3 authored by jan.koester's avatar jan.koester
Browse files

test

parent 9be73494
Loading
Loading
Loading
Loading
Loading
+4 −8
Changes for src/cluster.cpp: 4 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -515,14 +515,10 @@ namespace authdb {
            first_run = false;
            if (!running_ || !pclient_) continue;
            try {
                std::unique_lock<std::timed_mutex> lock;
                if (critical_ || degraded_) {
                    // When degraded/critical, briefly wait to ensure probes can execute
                    lock = std::unique_lock<std::timed_mutex>(client_mutex_, std::chrono::seconds(2));
                } else {
                    // Normal: non-blocking, don't fight session ops
                    lock = std::unique_lock<std::timed_mutex>(client_mutex_, std::try_to_lock);
                }
                // Always use try_to_lock — health probes must never starve
                // session pushes/fetches.  If we can't get the lock, skip
                // this cycle; the next one (3s or 10s later) will retry.
                std::unique_lock<std::timed_mutex> lock(client_mutex_, std::try_to_lock);
                if (!lock.owns_lock()) continue;
                auto health = pclient_->get_cluster_status();
                bool was_degraded = degraded_;