Opened 10 years ago

Closed 13 months ago

#11331 closed Patch - Feature (Trac EOL)

Allow SBE to answer BUSY to GO_TO_SLEEP from MBE and prevent shut down - resulting in MBE to sent GO_TO_SLEEP again later

Reported by: Jan.Lentfer@… Owned by:
Priority: minor Milestone: needs_triage
Component: MythTV - General Version: 0.24.2
Severity: medium Keywords: idle wake slave
Cc: Ticket locked: no


The patch will allow the sleepCommand on SBE to exit with exit code 2, which will be interpreted and sent to the MBE as "BUSY". If BUSY is received by the MBE when trying to shutdown idle slaves it will just do nothing (break out of the shutdown loop) and write an according notice to the log. The scheduler will handle to come back to the relevant SBE anyway (latest after 5 minutes afaict).

This is useful for e.g. (my use case) a SBE running on a box that does different things, too. With the current implementation the exit code of the sleepCommand isn't really checked - but the SBE is assumed to be going to sleep - just by the fact that the sleepCommand is configured.

E.g. I run a XBMC frontend that also runs a mythtv SBE with DVB-S and DVB-T. I need to run the DVB cards in there because the antenna cables end in the living room. I don't want to run the box 24x7 and I don't want mythtv to shut the box down while I am doing other things in xbmc, too. Problem is now, that when the MBE sends GO_TO_SLEEP it assumes the SBE will go to sleep... so tuners will not be available if I decide to watch LiveTV.

That is all solved (for me) with this patch. The SBE stays "online" as long as the box is actually doing something - and will shut down entirely when MythTV thinks it could go to sleep AND the sleepCommand (which checks for activitiy of all other services on this box) agrees.

This is very similar to #7762 - one might even think I stole from there - but honestly I didn't, I was pointed to this ticket on irc.

My patch is less complex and really just changes the handling of sleepCommands exit codes and adds an extra check in the scheduler to break from the shutdown loop.

Attachments (1)

mythbackend_slave_shutdown_busy.patch (4.4 KB) - added by Jan.Lentfer@… 10 years ago.
patch against head

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by Jan.Lentfer@…

patch against head

comment:1 Changed 10 years ago by Jan.Lentfer@…

Forgot to mention: The patch is against head - this is untested. I wrote and tesed the patch against 0.24.2 as this is still the version I am running. I think the patch is trivial enough for this being considered ok.

comment:2 Changed 3 years ago by Stuart Auchterlonie

Milestone: unknownneeds_triage
Version: Unspecified0.24.2

comment:3 Changed 13 months ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: newclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] -

Note: See TracTickets for help on using tickets.