Nir Soffer has uploaded a new change for review.

Change subject: xmlrpc: Disable needless and slow dns lookup
......................................................................

xmlrpc: Disable needless and slow dns lookup

BaseHTTPServer.BaseRequestHandler is invoking socket.getfqdn() after
each request, to log the client fully qualified hostname. If dns is not
configured properly, this cause needless delay after each request.

This patch override address_string to return client address, avoiding
the dns lookup.

Change-Id: I6b62d4a5b6765d3539c92b72e821b9029b043941
Signed-off-by: Nir Soffer <[email protected]>
---
M vdsm/BindingXMLRPC.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/24871/1

diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 259c262..ba51b75 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -200,6 +200,14 @@
                 threadLocal.flowID = self.headers.get(HTTP_HEADER_FLOWID)
                 return r
 
+            def address_string(self):
+                """
+                Override BaseHTTPServer.BaseRequestHandler implementation to
+                avoid pointless and slow attempt to get the fully qualified
+                host name from the client address.
+                """
+                return self.client_address[0]
+
         if self.enableSSL:
             KEYFILE, CERTFILE, CACERT = self._getKeyCertFilenames()
             server = SecureXMLRPCServer.SecureThreadedXMLRPCServer(


-- 
To view, visit http://gerrit.ovirt.org/24871
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b62d4a5b6765d3539c92b72e821b9029b043941
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to