[PATCH] rpc: Emit a warning when applying RPC throttling

Ivan Teterevkov posted 1 patch 1 week, 4 days ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220113084022.56967-1-ivan.teterevkov@nutanix.com
src/rpc/virnetserverclient.c | 4 ++++
1 file changed, 4 insertions(+)

[PATCH] rpc: Emit a warning when applying RPC throttling

Posted by Ivan Teterevkov 1 week, 4 days ago
Whenever the number of outstanding requests being served reaches
max_client_requests, the RPC server applies RX throttling and
temporarily stops receiving incoming data. Consequently, it stops
receiving the keep-alive responses from the client and eventually
may cause a connection timeout on the server-side.

This patch emits a warning message in such cases so that the users
may root-cause the connection timeout and reconfigure
max_client_requests depending on their application.

Signed-off-by: Ivan Teterevkov <ivan.teterevkov@nutanix.com>
---
 src/rpc/virnetserverclient.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 7050430e17..9d86e1ba3e 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1293,6 +1293,10 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
                 client->rx->buffer = g_new0(char, client->rx->bufferLength);
                 client->nrequests++;
             }
+        } else {
+            VIR_WARN("Applying RPC throttling, consider increasing "
+                     "max_client_requests (client->nrequests_max=%zu)",
+                     client->nrequests_max);
         }
         virNetServerClientUpdateEvent(client);
 
-- 
2.35.0-rc0