]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
xmlrpc server: delete function on errors
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Fri, 6 Mar 2015 15:42:03 +0000 (15:42 +0000)
committerAlexandru DAMIAN <alexandru.damian@intel.com>
Mon, 9 Mar 2015 13:15:20 +0000 (13:15 +0000)
This patch makes sure to delete an idle function that
raises an exception for the xmlrpc server.

The counterpart functionality in the process server was
added with:

commit db50630948394bdcd361f3511af40c1896b1a017.
duthor: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Wed Aug 20 22:31:06 2014 +0000

    bitbake: process: Deal with infinite looping of the server

This patch fixes

[YOCTO #7316]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
lib/bb/server/xmlrpc.py

index afe3dfe5df474c7149101360154e179fc52f2452..17f3d9d9063ccc1727fc96200770e5dc3aa40baf 100644 (file)
@@ -235,6 +235,7 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
             fds = [self]
             nextsleep = 0.1
             for function, data in self._idlefuns.items():
+                retval = None
                 try:
                     retval = function(self, data, False)
                     if retval is False:
@@ -248,6 +249,9 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
                 except:
                     import traceback
                     traceback.print_exc()
+                    if retval == None:
+                        # the function execute failed; delete it
+                        del self._idlefuns[function]
                     pass
 
             socktimeout = self.socket.gettimeout() or nextsleep