TVServerKodi causes a crash for TVservice

Discussion in 'General Support' started by karniemi, October 11, 2015.

  1. karniemi

    karniemi Portal Pro

    Joined:
    November 11, 2010
    Messages:
    65
    Likes Received:
    6
    Ratings:
    +8 / 0
    Hi,



    The actual root cause for the crash is probably in TVServerKodi:
    http://forum.kodi.tv/showthread.php?tid=242855

    But...should the plug-in interface of MP tolerate such exceptions...without stopping the TVservice? Anything that could be done in MP side for a more robust experience?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,485
    Likes Received:
    2,543
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,215 / 13
    Home Country:
    France France
    Show System Specs
    hello @karniemi, welcome on board,

    i'm despite to announce you, we can't help you on the kodi support, we are not able to use your Player, try on kodi forum. maybe member can have the solution.

    but, post your logs files, maybe we have an issue on our codes...
     
  4. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    @karniemi
    Thanks for reporting. :)
    From what I can see in the limited details you posted on the KODI forum, I agree that TVServerKodi seems to be causing the crash and there's nothing that TV Server can do to avoid it. Technically it is possible the root cause is something within TV Server itself (eg. related to accessing your recordings, or something like that). However that seems unlikely because we haven't had any similar reports of stability problems here.
     
  5. karniemi

    karniemi Portal Pro

    Joined:
    November 11, 2010
    Messages:
    65
    Likes Received:
    6
    Ratings:
    +8 / 0
    Thanks for such quick response. Attaching full log -I was supposed to add that in my orig. post in kodi forum....but I really could not find means to attach files there :-(.

    So...:
    1) MP TVService has no safety net for such issues in plugins? So a crash in a nice-to-have-plugin, brings down the whole TVservice process ...and disturbs the recording of my wifes required-to-record-favorite-tv-show...or my required-to-record-ron-jeremy-film...
    2) TVService has no watchdog that would start it again after crash?
     

    Attached Files:

  6. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    LOL at Ron Jeremy :D

    In answer to your question: of course TV Server has a safety net. However, plugins run in the same process as TV Server. Therefore internal plugin exceptions can still bring down the service as you have seen.

    No. The Windows service configuration seems to be adequate:
    upload_2015-10-13_10-47-39.png

    Change "take no action" to "restart the service" (or whatever you prefer).
     
  7. karniemi

    karniemi Portal Pro

    Joined:
    November 11, 2010
    Messages:
    65
    Likes Received:
    6
    Ratings:
    +8 / 0
    OK, did some studying... I started wondering that how come is some un-handled exception in a background thread bringing down the whole process...since that's not what I've experienced on other programming envs. Well, it seems to be a special case of .net since 2.0 version. And that really calls for some strict policy in the MP plug-in framework...and/or requires very disciplined&aware plug-in developers.[DOUBLEPOST=1444769279][/DOUBLEPOST]...so basically either MP should enclose all plugins/threads in try-catch blocks...or...the plug-ins should do that themselves. Or both. But well, my recordings are not quite that critical anyway :)...
     
    Last edited: October 13, 2015
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Pretty much, yes. :)

    TV Server registers to receive unhandled exceptions from any source within the process:
    https://github.com/MediaPortal/Medi...TvEngine3/TVLibrary/TvService/Service1.cs#L89

    The exception handler is here:
    https://github.com/MediaPortal/Medi...vEngine3/TVLibrary/TvService/Service1.cs#L111

    You can see that the exception handler is the source of the log entries that you found... and actually it is also responsible for stopping the service (ie. the exception isn't directly killing). We choose to stop the service because in that context (global process exception handler) it is not possible to know/determine if it is safe/appropriate to continue running... or whether the exception is really critical.
     
    • Informative Informative x 2
  9. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    MP/TV Server can (and already does - if we didn't we would be incompetent! ;) ) enclose all plugin calls in try-catch. For example:
    https://github.com/MediaPortal/Medi...ne3/TVLibrary/TvService/Service1.cs#L803-L812

    However we can't enclose the plugin internal threads/code. The plugin developers have to do that themselves.
     
    • Informative Informative x 2
  10. karniemi

    karniemi Portal Pro

    Joined:
    November 11, 2010
    Messages:
    65
    Likes Received:
    6
    Ratings:
    +8 / 0
    Would so much like to argue...but reading a few articles from ggl-srch "plugin .net catch exceptions thread" revealed that resistance is futile ;). Seems to be quite a common gotcha for AppDomains & .net plug-in applications. Thanks mm1352000!
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • 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.

             

  • 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!