﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
13072	Schedule busy looping with sched_sleep of 0	lucylangthorne55@…	gigem	"Setup: 0.28.0+fixes.20170715.eef6a480b0-0ubuntu3 with master, one slave, mythweb frontend.

Several times a day the scheduler runs 100% even though disks and mysql are idle.

It appears that sched_sleep has becomes 0 while a recording is about to start (around line 2040). This then causes continuous scheduling since it remains at zero so does not sleep and re-loops hundreds of times a second.

Strangely, the s2n only appears to decrease every few seconds whereas I expect it to be per second.

The busy looping appears to be responsible for an overall unresponsive system (can't start frontend), possibly due to a lock held.

I suspect altering sched_sleep from max(...,0) to max(...,1000) (around line 2019) to ensure a minimum sleep of a second would help.

"	Bug Report - General	closed	minor	29.0	MythTV - Scheduling	0.28.0	medium	fixed			0
