From patchwork Thu Jul 25 02:19:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 18555 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8ECC525E5F for ; Thu, 25 Jul 2013 02:19:29 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m13sf125315yen.9 for ; Wed, 24 Jul 2013 19:19:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=30ccKaP9qLMP/Qpan47JW4I7n3U9mxz82QQTuCskA7E=; b=KBR3gnX5gx4yF8gYmIYMoTRxXXMx2zSdoM67CiNSg8RVGhrnSjt1QbmcOB0iuS92Mv fvesugn3EzKMXvg96+g3kstMi2eVsMDSjleZFae42fFIHB3hsw2CPCPQhphwjQo6C3e2 Mdc53A9E980BtDW25xlH3LBGIl6yetanuqN+NYqa9YhuTKwUO2d8GR9SHXCgKTOMp94T OTEAdj1lQmNTZ/dSv+PPpLRsRU7/VSvUw5aYllmsSQNkCFFYJiqvFkcrXFASHvT6x6dA UY99cRL2P+KXyyVZJ17IaWx+rR2sWXfK9zvd87sf1L8/ruYNvhmT70IjYIiR3SIGZSCA sscA== X-Received: by 10.58.249.42 with SMTP id yr10mr4938276vec.40.1374718768753; Wed, 24 Jul 2013 19:19:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.14.71 with SMTP id n7ls536239qec.2.gmail; Wed, 24 Jul 2013 19:19:28 -0700 (PDT) X-Received: by 10.52.248.166 with SMTP id yn6mr13714636vdc.41.1374718768578; Wed, 24 Jul 2013 19:19:28 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id tk7si11410760vdc.91.2013.07.24.19.19.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 19:19:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id ox1so94225veb.27 for ; Wed, 24 Jul 2013 19:19:28 -0700 (PDT) X-Received: by 10.58.164.101 with SMTP id yp5mr16438059veb.0.1374718768405; Wed, 24 Jul 2013 19:19:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp55891veb; Wed, 24 Jul 2013 19:19:27 -0700 (PDT) X-Received: by 10.180.182.229 with SMTP id eh5mr262978wic.63.1374718767290; Wed, 24 Jul 2013 19:19:27 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id r5si274435wif.65.2013.07.24.19.19.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 24 Jul 2013 19:19:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1V2B9K-00037G-LE for ; Thu, 25 Jul 2013 02:19:26 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8C206E07B6 for ; Thu, 25 Jul 2013 02:19:26 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 641 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 641: force finishing of emulated devices Message-Id: <20130725021926.2458.29002.launchpad@ackee.canonical.com> Date: Thu, 25 Jul 2013 02:19:26 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16700"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 42daf8b334735e274399274fbdb5505ee4779131 X-Gm-Message-State: ALoCoQnVjTwbdcgRXU3JgtPtFVC9jlYpdtw4qCzzKwRDxDZ/QliHgaDpleE1Zqb38yVSE6t0ejsx X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ------------------------------------------------------------ revno: 641 committer: Antonio Terceiro branch nick: kill-fastmodel-process timestamp: Wed 2013-07-24 11:04:25 -0300 message: force finishing of emulated devices With both fastmodels and QEMU we have the risk of leaving runaway processes after a job finishes, what may block resources and impact future usage of the same (virtual) device (and it just wrong). This commit generalizes the solution I found before for QEMU and applies it to fastmodels as well. modified: lava_dispatcher/device/fastmodel.py lava_dispatcher/device/qemu.py lava_dispatcher/utils.py --- lp:lava-dispatcher https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk You are subscribed to branch lp:lava-dispatcher. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription === modified file 'lava_dispatcher/device/fastmodel.py' --- lava_dispatcher/device/fastmodel.py 2013-07-16 16:04:31 +0000 +++ lava_dispatcher/device/fastmodel.py 2013-07-24 14:04:25 +0000 @@ -46,6 +46,7 @@ ensure_directory, extract_targz, DrainConsoleOutput, + finalize_process, ) @@ -244,9 +245,8 @@ def power_off(self, proc): super(FastModelTarget, self).power_off(proc) - if self._sim_proc is not None: - self._sim_proc.close() - self._sim_proc = None + finalize_process(self._sim_proc) + self._sim_proc = None def _create_rtsm_ostream(self, ofile): """the RTSM binary uses the windows code page(cp1252), but the === modified file 'lava_dispatcher/device/qemu.py' --- lava_dispatcher/device/qemu.py 2013-07-16 16:03:32 +0000 +++ lava_dispatcher/device/qemu.py 2013-07-24 14:04:25 +0000 @@ -36,6 +36,7 @@ from lava_dispatcher.utils import ( ensure_directory, extract_targz, + finalize_process, ) @@ -77,9 +78,7 @@ return proc def power_off(self, proc): - if proc: - proc.kill(9) - proc.close() + finalize_process(proc) def get_device_version(self): try: === modified file 'lava_dispatcher/utils.py' --- lava_dispatcher/utils.py 2013-07-16 16:09:56 +0000 +++ lava_dispatcher/utils.py 2013-07-24 14:04:25 +0000 @@ -270,3 +270,9 @@ "{time.tm_hour:02}:{time.tm_min:02}:{time.tm_sec:02}Z").format( test_id=test_name, time=datetime.datetime.utcnow().timetuple()) + +def finalize_process(proc): + print("*** finalize_process ***") + if proc: + proc.kill(9) + proc.close()