Commit 502d273d authored by jan.koester's avatar jan.koester
Browse files

test

parent 3cdcb59e
Loading
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -778,9 +778,20 @@ int main(int argc,char *argv[]){

        // Cluster backends defer the network fetch to avoid constructor timeouts.
        // Force an initial fetch now so backend.end() returns the real size.
        // Retry because peers may still be loading their own data after a
        // full cluster restart.  The ClusterBackend throttles fetches to once
        // per 10s, so we sleep long enough between retries.
        if (clusterEnabled) {
            for (int attempt = 0; attempt < 12; ++attempt) {
                {
                    AuthBackend::Guard initGuard(backend, AuthBackend::Shared);
            (void)backend.end();
                    if (backend.end() > sizeof(authdb::AuthHeader))
                        break;
                }
                if (attempt == 0)
                    std::cerr << "[AUTHDB] waiting for cluster admin data..." << std::endl;
                std::this_thread::sleep_for(std::chrono::seconds(10));
            }
        }

        authdb::AuthDB authdb(backend,httpd.getServerSockets());