render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
735c6b
From 64dbfdfe3ed2fc8f252ce138f6213b529edb2407 Mon Sep 17 00:00:00 2001
735c6b
Message-Id: <64dbfdfe3ed2fc8f252ce138f6213b529edb2407@dist-git>
735c6b
From: Peter Krempa <pkrempa@redhat.com>
735c6b
Date: Wed, 15 Feb 2023 10:48:31 +0100
735c6b
Subject: [PATCH] rpc: Don't warn about "max_client_requests" in
735c6b
 single-threaded daemons
735c6b
MIME-Version: 1.0
735c6b
Content-Type: text/plain; charset=UTF-8
735c6b
Content-Transfer-Encoding: 8bit
735c6b
735c6b
The warning about max_client_requests is hit inside virtlogd every time
735c6b
a VM starts which spams the logs.
735c6b
735c6b
Emit the warning only when the client request limit is not 1 and add a
735c6b
warning into the daemon config to not configure it too low instead.
735c6b
735c6b
Fixes: 031878c2364
735c6b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145188
735c6b
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
735c6b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
735c6b
(cherry picked from commit b3f8e072fe08a6beaf3ec3d27e02efee4358b2ca)
735c6b
---
735c6b
 src/remote/libvirtd.conf.in  | 1 +
735c6b
 src/rpc/virnetserverclient.c | 3 ++-
735c6b
 2 files changed, 3 insertions(+), 1 deletion(-)
735c6b
735c6b
diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in
735c6b
index 80a98b1529..32a680317a 100644
735c6b
--- a/src/remote/libvirtd.conf.in
735c6b
+++ b/src/remote/libvirtd.conf.in
735c6b
@@ -374,6 +374,7 @@
735c6b
 # connection. To avoid one client monopolizing the server
735c6b
 # this should be a small fraction of the global max_workers
735c6b
 # parameter.
735c6b
+# Setting this too low may cause keepalive timeouts.
735c6b
 #max_client_requests = 5
735c6b
 
735c6b
 # Same processing controls, but this time for the admin interface.
735c6b
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
735c6b
index b5c764b1b0..bdb3552c5d 100644
735c6b
--- a/src/rpc/virnetserverclient.c
735c6b
+++ b/src/rpc/virnetserverclient.c
735c6b
@@ -1261,7 +1261,8 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
735c6b
             client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
735c6b
             client->rx->buffer = g_new0(char, client->rx->bufferLength);
735c6b
             client->nrequests++;
735c6b
-        } else if (!client->nrequests_warning) {
735c6b
+        } else if (!client->nrequests_warning &&
735c6b
+                   client->nrequests_max > 1) {
735c6b
             client->nrequests_warning = true;
735c6b
             VIR_WARN("Client hit max requests limit %zd. This may result "
735c6b
                      "in keep-alive timeouts. Consider tuning the "
735c6b
-- 
735c6b
2.39.1
735c6b