Heartbeats - a way for TVserver to keep track of live and dead clients .

Recently we have implemented heartbeat handshake/communication between the tvplugin and the TV server.

 

The purpose of this new feature is to avoid having locked tuner cards due to clients crashing. Before this feature, the server had no idea that the client was suddenly gone. The Tvserver was happily timeshifting away as if the client was still alive. This would effectively lead into a tuner-lock.

Now imagine this. If the wife now decies to tune into a channel on that locked tuner card on another multiseat client, then she would get the "no cards available" error.

A workaround to free up the timeshifting was to simply restart the tvservice, this would ofcourse kick off dead and inactive clients.

There could be many reasons as to why a client could become dead.

One of the more obvious ones could be a simple crash of mediaportal.

Now that heartbeat is fully implemented, this is no more (hopefully).

 

The client transmits a heartbeat each 5 sec. no matter what context TV is in.

The server allows for a 30sec timeout period before deciding to kick the client.

A seperate thread on the server runs through list of active users, checking if heartbeats have arrived or not.

If no heartbeat has ever been registered on a specific user, then the server is ignoring this particular user - giving it full imunity.

So VLC clients that doesn't send heartbeats and similar are not kicked ever.

The same goes for the scheduler, epg users etc. They are more "fake" service oriented users used in the tv service. 

 

All is logged to the servers tv.log 

And in the client's mediaportal.log (debug logging enabled)

So if any issues arise, those logs should tell the tale of what has happened. 

 

A note to the devs when debugging tvplugin;

If you find yourself being kicked when debugging tvplugin, this could be that your are simply standing in a breakpoint, thus preventing the client from emitting heartbeats in time. 

A temp. solution is to disable heartbeat on the client (in tvhome.sendheart()). this would give you immunity.

 

/Gibman 

 

About The Project

The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

In reaching this goal we are working every day to make sure our software is one of the best.

         

Quick Navigation

  • Home
  • About MediaPortal
  • Bugtracker
  • Download
  • Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!
  • Our Partners

Support MediaPortal!

The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

Care to support our work with a few bucks? We'd really appreciate it!


Wir benutzen Cookies

Wir nutzen Cookies auf unserer Website. Einige von ihnen sind essenziell für den Betrieb der Seite, während andere uns helfen, diese Website und die Nutzererfahrung zu verbessern (Tracking Cookies). Ebenfalls dienen sie der Personalisierung von Ads (Werbung). Sie können selbst entscheiden, ob Sie die Cookies zulassen möchten. Bitte beachten Sie, dass bei einer Ablehnung womöglich nicht mehr alle Funktionalitäten der Seite zur Verfügung stehen.