TVServerKodi causes a crash for TVservice (1 Viewer)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    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...
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    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.
     

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    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?
     

    Attachments

    • TVService.1.zip
      4.6 KB

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    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...
    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.

    2) TVService has no watchdog that would start it again after crash?
    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).
     

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    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:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    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.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    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!
     

    Users who are viewing this thread

    Top Bottom