1
0
Fork 0

Merge pull request #144 from olysonek/master

scheduler: Keep polling file objects alive long enough
This commit is contained in:
Jaroslav Škarvada 2018-12-14 17:47:25 +01:00 committed by GitHub
commit 9d8234d559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -448,7 +448,11 @@ class SchedulerPlugin(base.Plugin):
def _thread_code(self, instance):
r = self._cmd.re_lookup_compile(instance._sched_lookup)
poll = select.poll()
for fd in instance._evlist.get_pollfd():
# Store the file objects in a local variable so that they don't
# go out of scope too soon. This is a workaround for
# python3-perf bug rhbz#1659445.
fds = instance._evlist.get_pollfd()
for fd in fds:
poll.register(fd)
while not instance._terminate.is_set():
# timeout to poll in milliseconds