]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pakfire/patches/0009-builder-Remove-pids-from-list-of-running-jobs-when-j.patch
pakfire: Import latest patches from upstream.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0009-builder-Remove-pids-from-list-of-running-jobs-when-j.patch
CommitLineData
6ef17b23
MT
1From c3319c905d03176308e01175f344cf33bd926113 Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Sun, 3 Feb 2013 21:36:00 +0100
91d1c8a9 4Subject: [PATCH 09/17] builder: Remove pids from list of running jobs when job
6ef17b23
MT
5 has finished.
6
7---
8 python/pakfire/client/builder.py | 5 ++++-
9 1 file changed, 4 insertions(+), 1 deletion(-)
10
11diff --git a/python/pakfire/client/builder.py b/python/pakfire/client/builder.py
12index 9798cc4..2d6280c 100644
13--- a/python/pakfire/client/builder.py
14+++ b/python/pakfire/client/builder.py
15@@ -251,6 +251,8 @@ class PakfireDaemon(object):
16
17 # Finally, remove the process from the process list.
18 self.processes.remove(process)
19+ if self.pid2jobid.has_key(process.id):
20+ del self.pid2jobid[process.id]
21
22 return ret
23
24@@ -274,7 +276,6 @@ class PakfireDaemon(object):
25 for process in self.processes[:]:
26 job_id = self.pid2jobid.get(process.pid, None)
27 if job_id and job_id in aborted_jobs:
28-
29 # Kill the process.
30 log.info("Killing process %s which was aborted by the user." \
31 % process.pid)
32@@ -283,6 +284,8 @@ class PakfireDaemon(object):
33 # Remove the process from the process list to avoid
34 # that is will be cleaned up in the normal way.
35 self.processes.remove(process)
36+ if self.pid2jobid.has_key(process.id):
37+ del self.pid2jobid[process.id]
38
39 return True
40
41--
91d1c8a9 421.8.1.2
6ef17b23 43