Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10837 closed Bug Report - General (fixed)

Script using System class of python bindings python process runs at 100% CPU while performing task

Reported by: djo <david.osguthorpe@…> Owned by: Raymond Wagner
Priority: minor Milestone: 0.25.2
Component: Bindings - Python Version: 0.25-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The calling python process runs at 100% while performing a task via the System class
Script is based on transcode_stub.py

Issue appears to be in the _PollingThread subclass of DequeBuffer? in the run function
The timeout in the poll call of the for loop is given as 0.1 (0.25-fixes update) but this poll function parameter is in milliseconds (python 2.7 online documentation). Probably 0.1 seconds was meant, ie 100 milliseconds
Changing the line

for fd,event in poller.poll(0.1):

to

for fd,event in poller.poll(100.0):

fixes problem

Change History (3)

comment:1 Changed 6 years ago by Raymond Wagner <rwagner@…>

Resolution: fixed
Status: newclosed

In 76433930fed60342a4b2929c6ff94a8413673e5b/mythtv:

Changes seconds to milliseconds in poller loop.

This corrects the timeout duration in the poller loop used to read data
from external programs. Code was written assuming timeouts in floating
point seconds, while poll() API takes milliseconds. Ahh.. consistency..

Fixes #10837

comment:2 Changed 6 years ago by Raymond Wagner <rwagner@…>

In 6aa7fbe106dbf88c2c067a0184a52d814cef1978/mythtv:

Changes seconds to milliseconds in poller loop.

This corrects the timeout duration in the poller loop used to read data
from external programs. Code was written assuming timeouts in floating
point seconds, while poll() API takes milliseconds. Ahh.. consistency..

Fixes #10837
(cherry picked from commit 76433930fed60342a4b2929c6ff94a8413673e5b)

comment:3 Changed 6 years ago by Raymond Wagner

Milestone: unknown0.25.2
Note: See TracTickets for help on using tickets.