]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: Don't warn about "max_client_requests" in single-threaded daemons
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Feb 2023 09:48:31 +0000 (10:48 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 15 Feb 2023 11:36:17 +0000 (12:36 +0100)
The warning about max_client_requests is hit inside virtlogd every time
a VM starts which spams the logs.

Emit the warning only when the client request limit is not 1 and add a
warning into the daemon config to not configure it too low instead.

Fixes: 031878c2364
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145188
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/remote/libvirtd.conf.in
src/rpc/virnetserverclient.c

index 80a98b1529c89f1152a6a364e41a16bec83ad39f..32a680317acc7d7fd7f30f4b83078d6030d7f38a 100644 (file)
 # connection. To avoid one client monopolizing the server
 # this should be a small fraction of the global max_workers
 # parameter.
+# Setting this too low may cause keepalive timeouts.
 #max_client_requests = 5
 
 # Same processing controls, but this time for the admin interface.
index b5c764b1b0e2e74e9e8b26a0e4f64cb78467f499..bdb3552c5dee3529c8d17057b0bc02cc80333dfc 100644 (file)
@@ -1261,7 +1261,8 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
             client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
             client->rx->buffer = g_new0(char, client->rx->bufferLength);
             client->nrequests++;
-        } else if (!client->nrequests_warning) {
+        } else if (!client->nrequests_warning &&
+                   client->nrequests_max > 1) {
             client->nrequests_warning = true;
             VIR_WARN("Client hit max requests limit %zd. This may result "
                      "in keep-alive timeouts. Consider tuning the "