Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 251EBE00B63; Mon, 21 Mar 2016 05:30:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E0E68E00803 for ; Mon, 21 Mar 2016 05:30:04 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 21 Mar 2016 05:30:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,372,1455004800"; d="scan'208";a="673153997" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by FMSMGA003.fm.intel.com with ESMTP; 21 Mar 2016 05:30:02 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX106.ger.corp.intel.com (163.33.3.31) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Mar 2016 12:30:01 +0000 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.10]) by irsmsx155.ger.corp.intel.com ([169.254.14.201]) with mapi id 14.03.0248.002; Mon, 21 Mar 2016 12:30:01 +0000 From: "Barros Pena, Belen" To: Ed Bartosh , "toaster@yoctoproject.org" Thread-Topic: [Toaster] [PATCH] bitbake: xmlrpc: set single use mode differently Thread-Index: AQHRgDEmYyxX3fX3Cke/PvCo0j4gE59j2mIA Date: Mon, 21 Mar 2016 12:30:01 +0000 Message-ID: References: <1458199260-19726-1-git-send-email-ed.bartosh@linux.intel.com> In-Reply-To: <1458199260-19726-1-git-send-email-ed.bartosh@linux.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.6.2.160219 x-originating-ip: [10.237.224.41] MIME-Version: 1.0 Subject: Re: [PATCH] bitbake: xmlrpc: set single use mode differently X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 12:30:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable On 17/03/2016 07:21, "toaster-bounces@yoctoproject.org on behalf of Ed Bartosh" wrote: >Currently xmlrpc server implicitly sets itself into single use mode >when bitbake server is started with anonymous port (0) or no port is >provided in command line. In this mode bitbake shuts down xmlrpc server >after build is done. This assumption is incorrect in some cases. >For example Toaster uses bitbake in this mode and expects xmlrpc server >to stay in memory. > >Till recent changes single use mode was always unset due to the bug. >When the bug was fixed it broke toaster builds as Toaster couldn't >communicate with bitbake server in single use mode. > >Reimplemented logic of setting single use mode. The mode is explicity >set when --server-only command line parameter is not provided to bitbake. >It doesn't depend on the port number anymore. > >[YOCTO #9275] >[YOCTO #9240] >[YOCTO #9252] I know this has been sent upstream, but fwiw, I've applied it on top of master and Toaster still refuses to build. Starting a build spawns a ton of process like this python /home/belen/toaster/bitbake/bin/bitbake --read conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 I could be doing something wrong though. Cheers Bel=E9n > >Signed-off-by: Ed Bartosh >--- > bitbake/lib/bb/main.py | 5 +++-- > bitbake/lib/bb/server/process.py | 2 +- > bitbake/lib/bb/server/xmlrpc.py | 8 ++++---- > 3 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py >index bf59793..a28c751 100755 >--- a/bitbake/lib/bb/main.py >+++ b/bitbake/lib/bb/main.py >@@ -282,12 +282,13 @@ class >BitBakeConfigParameters(cookerdata.ConfigParameters): >=20 > def start_server(servermodule, configParams, configuration, features): > server =3D servermodule.BitBakeServer() >+ single_use =3D not configParams.server_only > if configParams.bind: > (host, port) =3D configParams.bind.split(':') >- server.initServer((host, int(port))) >+ server.initServer((host, int(port)), single_use) > configuration.interface =3D [ server.serverImpl.host, >server.serverImpl.port ] > else: >- server.initServer() >+ server.initServer(single_use=3Dsingle_use) > configuration.interface =3D [] >=20 > try: >diff --git a/bitbake/lib/bb/server/process.py >b/bitbake/lib/bb/server/process.py >index e387b30..a3078a8 100644 >--- a/bitbake/lib/bb/server/process.py >+++ b/bitbake/lib/bb/server/process.py >@@ -242,7 +242,7 @@ class ProcessEventQueue(multiprocessing.queues.Queue): >=20 >=20 > class BitBakeServer(BitBakeBaseServer): >- def initServer(self): >+ def initServer(self, single_use=3DTrue): > # establish communication channels. We use bidirectional pipes >for > # ui <--> server command/response pairs > # and a queue for server -> ui event notifications >diff --git a/bitbake/lib/bb/server/xmlrpc.py >b/bitbake/lib/bb/server/xmlrpc.py >index a79b490..48d45d8 100644 >--- a/bitbake/lib/bb/server/xmlrpc.py >+++ b/bitbake/lib/bb/server/xmlrpc.py >@@ -189,12 +189,12 @@ class XMLRPCServer(SimpleXMLRPCServer, >BaseImplServer): > # remove this when you're done with debugging > # allow_reuse_address =3D True >=20 >- def __init__(self, interface): >+ def __init__(self, interface, single_use=3DFalse): > """ > Constructor > """ > BaseImplServer.__init__(self) >- self.single_use =3D interface[1] =3D=3D 0 # anonymous port, not >getting reused >+ self.single_use =3D single_use > # Use auto port configuration > if (interface[1] =3D=3D -1): > interface =3D (interface[0], 0) >@@ -335,9 +335,9 @@ class >BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection): > pass >=20 > class BitBakeServer(BitBakeBaseServer): >- def initServer(self, interface =3D ("localhost", 0)): >+ def initServer(self, interface =3D ("localhost", 0), single_use =3D >False): > self.interface =3D interface >- self.serverImpl =3D XMLRPCServer(interface) >+ self.serverImpl =3D XMLRPCServer(interface, single_use) >=20 > def detach(self): > daemonize.createDaemon(self.serverImpl.serve_forever, >"bitbake-cookerdaemon.log") >--=20 >2.1.4 > >--=20 >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster