Commit 09cd0a87 authored by jan.koester's avatar jan.koester
Browse files

test

parent d73a1516
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -966,6 +966,14 @@ int main(int argc,char *argv[]){

        authdb::AuthDB authdb(backend,httpd->getServerSockets());

        // netplus::event's default is just the core count — mediadb boosts
        // the same base class to max(cores*4, 16) (server.cpp) since request
        // handlers can block on cluster round-trips; authdb's session-lookup
        // path (Cluster::fetchSessionBySid) has the same shape, so give it
        // the same margin instead of running with far fewer worker threads
        // than the service it authenticates for.
        authdb.threads = std::max(authdb.threads * 4, 16);

        // Pre-load all domain backends into cache so API requests
        // don't need to lock the admin backend for domain resolution.
        if (backend.end() > sizeof(authdb::AuthHeader))
+12 −1
Original line number Diff line number Diff line
@@ -928,7 +928,18 @@ namespace authdb {

        if (session_read_client_) {
            try {
                auto data = session_read_client_->retrieve(sid_gid);
                // Bound the whole call — omitting the deadline gives every
                // stripe its own independent ~30s retry budget (see
                // paritypp::client::retrieve()'s doc comment), which can hang
                // an authdb worker thread for a long time while the session
                // cluster is degraded. authdb's HTTP server doesn't boost its
                // worker-thread count the way mediadb's does, so a handful of
                // concurrent misses like that is enough to exhaust the whole
                // pool. Session lookups fail closed (return false below) well
                // before the cluster's own health_monitor_loop would flag it
                // critical and short-circuit this call entirely.
                auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(5);
                auto data = session_read_client_->retrieve(sid_gid, deadline);
                if (!data.empty()) {
                    int64_t created_at;
                    if (SessionBlock::deserialize(data, sid, uid, did, members, username, gpo_results, created_at)) {