1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake: server/xmlrpc/prserv: Add sane timeout to default xmlrpc server

The standard python socket connect has long timouts which make sense for remote
connections but not local things like the PR Service. This adds a timeout
parameter to the common xmlrpc server creation function and sets it to a more
reasonable 5 seconds.

Making the PR server instantly exit is a good way to test the effect of this
on bitbake.

We can remove the bodged timeout in the PRServer terminate function which
has the side effect of affecting global scope.

(Bitbake rev: 8c01cff94787abbb64fbdf0c16cd63f8f97a7e03)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-08-24 12:03:10 +00:00
parent a03a423c60
commit bfab986ccd
2 changed files with 18 additions and 7 deletions
-3
View File
@@ -186,9 +186,6 @@ class PRServerConnection():
self.connection, self.transport = bb.server.xmlrpc._create_server(self.host, self.port)
def terminate(self):
# Don't wait for server indefinitely
import socket
socket.setdefaulttimeout(2)
try:
logger.info("Terminating PRServer...")
self.connection.quit()