Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 7 years ago

Closed 3 years ago

#3597 closed enhancement (fixed)

EIT scanner breaks idle shutdown

Reported by: anonymous Owned by: stuartm
Priority: minor Milestone: 0.25
Component: MythTV - EIT Version: head
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

Hi,

I tried to set up my computer so that it goes to sleep when mythbackend
is idle.

I set the idle timeout value to 10 minutes, but this didn't work as
expected. The EIT scanner causes a reschedule that disturbs the idle
countdown and resets it frequently, so that the backend may never go
to sleep.

I solved this with a patch (see the attachment) that prevents the
scheduler from resetting the idle countdown.

Now the idle timer works as expected. You can see how the patch works
by looking into the log file:

2007-06-11 11:58:25.811 scheduler: Scheduled items: Scheduled 7 items in 0.2 =
2007-06-11 11:58:25.811 Resetting of idleSince aborted!

Attachments (4)

scheduler_idle_countdown_reset_fix.diff (644 bytes) - added by tino.keitel+mythtv@… 7 years ago.
fix to prevent the scheduler from resetting the idle countdown
backend-log (1.7 KB) - added by tino.keitel+mythtv@… 7 years ago.
log snipset with the patch attached
scheduler.cpp.diff (1.8 KB) - added by amb@… 4 years ago.
Updated patch for scheduler
scheduler.cpp.2.diff (1.6 KB) - added by amb@… 3 years ago.
Updated patch for scheduler for 0.24-fixes

Download all attachments as: .zip

Change History (22)

Changed 7 years ago by tino.keitel+mythtv@…

fix to prevent the scheduler from resetting the idle countdown

comment:1 Changed 7 years ago by tino.keitel+mythtv@…

Hi,

any comments to the patch? Is it crap? Does it have side effects? Can this issue solved in a different way?

To make the problem and the solution in the patch more clear, I attach a log snipset from my backend. As you can see, the scheduler disturbs the idle countdown multiple times. Thanks to the patch, the countdown won't be reset and the backend does a shutdown after 600 seconds.

Regards,
Tino

Changed 7 years ago by tino.keitel+mythtv@…

log snipset with the patch attached

comment:2 Changed 7 years ago by danielk

  • Component changed from mythtv to eit
  • Owner changed from ijr to stuarta
  • Type changed from defect to enhancement
  • Version changed from unknown to head

comment:3 Changed 7 years ago by bailey@…

I don't have a functioning mythtv system at the moment (long story), but this was a show stopper for me running the system exactly as I wanted, i.e. firing up the backend to record programmes I am always interested in, and actually using a tuner on my Mac FE to watch TV "ad-hoc", with recorded programmes going on to a network drive.

comment:4 Changed 7 years ago by stuarta

  • Milestone changed from unknown to 0.21
  • Status changed from new to assigned

comment:5 Changed 7 years ago by maverik044

There are a few threads on this subject as to why the proposed change may not be enough (http://www.gossamer-threads.com/lists/mythtv/dev/196893). Also I would expect there may be an issue if the scheduler does need to reschedule events, and the idle time is close to zero. In the reschedule event is to starting recording within some seconds, the backend may not have enough time to start the recording before the shutdown starts. It may be safer to reset the idle timer to 30 seconds if there is less than 30 seconds remaining to shutdown. Or if items have been rescheduled, reset the timer, if nothing is rescheduled, do not reset the idle timer.

comment:6 Changed 6 years ago by stuarta

  • Milestone changed from 0.21 to 0.22

comment:7 Changed 5 years ago by stuartm

  • Milestone changed from 0.22 to unknown

comment:8 Changed 5 years ago by stuartm

  • Component changed from eit to MythTV - EIT

comment:9 Changed 4 years ago by amb@…

This bug should not be against "MythTV - EIT" since any reschedule will cause the idle shutdown to be restarted, not just one from EIT.

I can confirm the problem still exists with 0.22-fixes.

Changed 4 years ago by amb@…

Updated patch for scheduler

comment:10 Changed 4 years ago by stuartm

  • Owner changed from stuarta to danielk
  • Status changed from accepted to assigned

comment:11 Changed 4 years ago by stuartm

  • Owner changed from danielk to stuarta

Wrong Ticket.

comment:12 Changed 3 years ago by anonymous

This issue also affects me and it would save me a lot of electricity if the mythtv box could just shutdown reliable.

comment:13 Changed 3 years ago by stuartm

  • Ticket locked set

comment:14 Changed 3 years ago by stuartm

  • Ticket locked unset

Changed 3 years ago by amb@…

Updated patch for scheduler for 0.24-fixes

comment:15 Changed 3 years ago by mellamanjefe@…

For those of us using EIT this is a tough choice between power savings and keeping our schedules up to date. I look forward to the implementation on 0.24, I am currently running mythbuntu 0.23-fixes. I am not familiar with the code but reading some of the previous suggestions and thinking about the problem I would be willing to work with a user setting that prevents the idle timeout from resetting even when new EIT modifications are received so that the computer will still shut down even if it recently received an EIT update. If I turn the computer off manually I'm going to miss all the updates anyway until I turn it back on. I would also help then to ask the user if a previously scheduled recording that is now deactivated because it cannot be matched to a guide entry (since the EIT might not be up to date when the computer starts after an extended shutdown) should remain active and record whatever timeslot it was scheduled to record. There will be little chance the user would end up recording something other than what was scheduled anyhow.

In any case, thanks for the great work!

comment:16 Changed 3 years ago by mdean

  • Ticket locked set

comment:17 Changed 3 years ago by stuartm

  • Milestone changed from unknown to 0.25
  • Owner changed from stuarta to stuartm
  • Status changed from assigned to accepted

If there are no immediate objections, I'll apply this tonight. There are consequences to ignoring reschedules when deciding to shutdown the backend but it seems to me that those people who prefer the power savings are already gambling that last minute schedule changes won't occur.

comment:18 Changed 3 years ago by Github

  • Resolution set to fixed
  • Status changed from accepted to closed

Do not allow EIT to prevent backend shutdown through last minute reschedules. Closes #3597

Signed-off-by: Stuart Morgan <smorgan@…>

Branch: master
Changeset: de0d29c8b6e3a1f9a0b07d82a07d9a2dd85a3973

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.