From bf3d23312eceecfb8b6d9be699379d8c339a87b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Wed, 1 Oct 2014 16:31:11 +0200 Subject: [PATCH] plugin_scheduler: do not unapply tunings for non-exitent processes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- tuned/plugins/plugin_scheduler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 381670d..2d8f1f6 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -165,6 +165,9 @@ class SchedulerPlugin(base.Plugin): ps = self.get_processes() for pid, vals in instance._scheduler_original.iteritems(): # if command line for the pid didn't change, it's very probably the same process - if ps[pid] == vals[0]: - self._set_rt(pid, self._sched2param(vals[1]), vals[2]) - self._set_affinity(pid, vals[3]) + try: + if ps[pid] == vals[0]: + self._set_rt(pid, self._sched2param(vals[1]), vals[2]) + self._set_affinity(pid, vals[3]) + except KeyError as e: + pass