]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_server: improve debugging in rpc_host_distribute_clients()
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Oct 2023 12:21:44 +0000 (14:21 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 17 Oct 2023 19:20:38 +0000 (19:20 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_server/rpc_host.c

index 9aee90620ede77e34b9d122fcf07ab960c444585..4e74706fd480e28d15819dfbf12d5169576dc176 100644 (file)
@@ -1298,6 +1298,7 @@ static void rpc_host_distribute_clients(struct rpc_server *server)
        struct iovec iov;
        enum ndr_err_code ndr_err;
        NTSTATUS status;
+       const char *client_type = NULL;
 
 again:
        pending_client = server->pending_clients;
@@ -1312,6 +1313,8 @@ again:
                size_t num_workers = talloc_array_length(server->workers);
                uint16_t worker_index = assoc_group_id >> 16;
 
+               client_type = "associated";
+
                if (worker_index >= num_workers) {
                        DBG_DEBUG("Invalid assoc group id %"PRIu32"\n",
                                  assoc_group_id);
@@ -1328,6 +1331,7 @@ again:
                        /*
                         * Pick a random one for a proper bind nack
                         */
+                       client_type = "associated+lost";
                        worker = rpc_host_find_worker(server);
                }
        } else {
@@ -1336,20 +1340,24 @@ again:
                uint32_t flags = 0;
                bool found;
 
+               client_type = "new";
+
                found = security_token_find_npa_flags(
                        session_info->session_info->security_token,
                        &flags);
 
                /* fresh assoc group requested */
                if (found & (flags & SAMBA_NPA_FLAGS_NEED_IDLE)) {
+                       client_type = "new+exclusive";
                        worker = rpc_host_find_idle_worker(server);
                } else {
+                       client_type = "new";
                        worker = rpc_host_find_worker(server);
                }
        }
 
        if (worker == NULL) {
-               DBG_DEBUG("No worker found\n");
+               DBG_DEBUG("No worker found for %s client\n", client_type);
                return;
        }
 
@@ -1366,7 +1374,8 @@ again:
                goto done;
        }
 
-       DBG_INFO("Sending new client %s to %d with %"PRIu32" clients\n",
+       DBG_INFO("Sending %s client %s to %d with %"PRIu32" clients\n",
+                client_type,
                 server->rpc_server_exe,
                 worker->pid,
                 worker->num_clients);