Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id F1785784BC for ; Fri, 28 Jul 2017 14:55:32 +0000 (UTC) Received: from hex ([192.168.3.34]) (authenticated bits=0) by dan.rpsys.net (8.15.2/8.15.2/Debian-3) with ESMTPSA id v6SEtU8g005838 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 28 Jul 2017 15:55:31 +0100 Received: from richard by hex with local (Exim 4.86_2) (envelope-from ) id 1db6fq-0005bw-Rt; Fri, 28 Jul 2017 15:55:30 +0100 From: Richard Purdie To: bitbake-devel@lists.openembedded.org Date: Fri, 28 Jul 2017 15:55:25 +0100 Message-Id: <1501253729-21511-3-git-send-email-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501253729-21511-1-git-send-email-richard.purdie@linuxfoundation.org> References: <1501253729-21511-1-git-send-email-richard.purdie@linuxfoundation.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (dan.rpsys.net [192.168.3.1]); Fri, 28 Jul 2017 15:55:32 +0100 (BST) X-Virus-Scanned: clamav-milter 0.99.2 at dan X-Virus-Status: Clean Subject: [PATCH 3/7] process: Allow BBUIEventQueue to exit cleanly X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 14:55:33 -0000 Currently the monitoring thread exits with some error code or runs indefinitely. Allow closure of the pipe its monitoring to have the thread exit cleanly/silently. Signed-off-by: Richard Purdie --- lib/bb/server/process.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 8a7c431..3d9077f 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -499,9 +499,14 @@ class BBUIEventQueue: def startCallbackHandler(self): bb.utils.set_process_name("UIEventQueue") while True: - self.reader.wait() - event = self.reader.get() - self.queue_event(event) + try: + self.reader.wait() + event = self.reader.get() + self.queue_event(event) + except EOFError: + # Easiest way to exit is to close the file descriptor to cause an exit + break + self.reader.close() class ConnectionReader(object): -- 2.7.4