Blame SOURCES/0001-scheduler-Keep-polling-file-objects-alive-long-enoug.patch

1bfeda
From a54b35c3b0c3b228eb924ed4ebfb964eead86cca Mon Sep 17 00:00:00 2001
1bfeda
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
1bfeda
Date: Fri, 14 Dec 2018 13:13:58 +0100
1bfeda
Subject: [PATCH] scheduler: Keep polling file objects alive long enough
1bfeda
MIME-Version: 1.0
1bfeda
Content-Type: text/plain; charset=UTF-8
1bfeda
Content-Transfer-Encoding: 8bit
1bfeda
1bfeda
Make sure the file objects returned by evlist.get_pollfd()
1bfeda
don't go out of scope and get destroyed too soon. This is
1bfeda
a workaround for python3-perf rhbz#1659445.
1bfeda
1bfeda
Resolves: rhbz#1659140
1bfeda
1bfeda
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
1bfeda
---
1bfeda
 tuned/plugins/plugin_scheduler.py | 6 +++++-
1bfeda
 1 file changed, 5 insertions(+), 1 deletion(-)
1bfeda
1bfeda
diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py
1bfeda
index 93b6d91..22e49d3 100644
1bfeda
--- a/tuned/plugins/plugin_scheduler.py
1bfeda
+++ b/tuned/plugins/plugin_scheduler.py
1bfeda
@@ -448,7 +448,11 @@ class SchedulerPlugin(base.Plugin):
1bfeda
 	def _thread_code(self, instance):
1bfeda
 		r = self._cmd.re_lookup_compile(instance._sched_lookup)
1bfeda
 		poll = select.poll()
1bfeda
-		for fd in instance._evlist.get_pollfd():
1bfeda
+		# Store the file objects in a local variable so that they don't
1bfeda
+		# go out of scope too soon. This is a workaround for
1bfeda
+		# python3-perf bug rhbz#1659445.
1bfeda
+		fds = instance._evlist.get_pollfd()
1bfeda
+		for fd in fds:
1bfeda
 			poll.register(fd)
1bfeda
 		while not instance._terminate.is_set():
1bfeda
 			# timeout to poll in milliseconds
1bfeda
-- 
1bfeda
2.17.2
1bfeda