Concurrent timeshift epg crash/stop tv service, unhandled app domain exception (1 Viewer)

SciDoctor

Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    Recently updated my server to a clean instal of 1.2.3, all databases and files. All previous MP releases used didn't have this problem. 1.2.2 was fine but I will reinstal and test again.

    2012-05-22 23:00:50.779125 [EPG Update thread(21)]: Tvservice stopped due to an unhandled app domain exception Error: StatementErrorUnclassified
    Gentle.Common.GentleException: select idProgram, idChannel, startTime, endTime, title, description, genre, [state], originalAirDate, seriesNum, episodeNum, episodePart, episodeName, starRating, classification, parentalRating from Program where title = @title and startTime = @startTime and endTime = @endTime and idChannel = @idChannel; ---> System.Data.SqlClient.SqlException: Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

    It is possibly linked to this error in the EPG update logs


    2012-05-22 22:59:35.622875 [EPG Update thread(21)]: Exception in Program.Persist() with Message insert into Program ( idChannel, startTime, endTime, title, description, genre, [state], originalAirDate, seriesNum, episodeNum, episodePart, episodeName, starRating, classification, parentalRating ) values ( @idChannel, @startTime, @endTime, @title, @description, @genre, @state, @originalAirDate, @seriesNum, @episodeNum, @episodePart, @episodeName, @starRating, @classification, @parentalRating ); select SCOPE_IDENTITY();




    It looks like there is now a conflict as multiple TIMESHIFT EPG update threads access the database at the same time which causes the exception and the TVService stops in a forced manner.

    I have the TVservice set to restart on errors so the impact is lessened.

    I will try and get 1.2.2 to a similar situation this evening and see if it produces the same result, more logs to follow and better initial logs from 1.2.3 as I am working remotely and don't have a clean connection to the server via remote desktop so just working from network folders.
     

    Attachments

    • Tvservice stopped due to an unhandled app domain exception.JPG
      Tvservice stopped due to an unhandled app domain exception.JPG
      266.3 KB
    • EPG error.JPG
      EPG error.JPG
      246.5 KB

    SciDoctor

    Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    Complete logs attached for the bug with a test of 1.3.0 alpha 1715 build.

    I have initialy used a newer build to see if the bug persists than in my first post, i will now regress to see if I can find where the bug didn't occur. I know it did not in 1.2.2

    At the moment my server is now unstable with post 1.2.3 final builds when timesift epg is running concurrent threads. ie two or more recordings starting at the same time so that their respective epg updates update the databse at the same time. (VISTA 64 full updates and MS SQL)
     

    Attachments

    • 1715 build bug crash tv server forced stop.JPG
      1715 build bug crash tv server forced stop.JPG
      326.6 KB

    SciDoctor

    Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    Further testing has shown that the error is more likely to be critical when there is no cpu bottleneck ie on more powrful multicore cpu systems where there is more occurances of the database being hit with concurrent requests.

    The attached logs show a cpu limited single core sytem with serious bottleneck (not a bad thing with this test) running 5 concurrent recordings with timeshft epg, as you can see the error occurs very very rarely and as such the tvservice is less likely to be stopped by the app domaain exception

    Previous logs above have been from a dual opteron server with no cpu bottlenecks and the error always happens as the concurrence is guaranteed with the speed the multi cpu process the epg threads.
     

    Attachments

    • EPG update conflict error.JPG
      EPG update conflict error.JPG
      398.7 KB

    mm1352000

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

    First, big thanks for taking the time to investigate. (y)
    Did you manage to confirm whether regression to 1.2.2 or 1.2.3 reverted the behaviour?
    I note that I am not able to use the DVB EPG grabber so it is difficult for me to test.

    mm
     

    SciDoctor

    Retired Team Member
  • Premium Supporter
  • February 2, 2005
    1,465
    139
    England
    Long delay in further investigation, sorry about that, although the problem has been on going; I either work around it by changing pre record for each concurrent recording (laboroius) or just live with it and allow the tvserver to restart on failure ( I lose about a minute or two between files).

    Using the latest 1.3a on VISTA.

    Did revert to earlier 1.2.3 and problem persists although when I was running these initialy my cpu wasn't powerful enough to have spare %cycles (single core 3200) but now it does (dual core 4400)

    This week I have done some further investigation mainly due to running the W8 update checker which showed the SQl 2005 would not be compatable. I doubt I will upgrade to W8!

    Even so I thought the app domain problem may be because of the older SQL so I upgraded to SQL 2008 on the VISTA instals, Unfortunately this made no difference.

    Logs attached again last set with SQL 2008.

    The errors occur when one EPG thread is accessing the same database field as another EPG thread.

    Hope this helps in tracking the little BUG er down as it is the only critical BUG I have with MP.
     

    Attachments

    • EPG settings.JPG
      EPG settings.JPG
      100.6 KB

    Users who are viewing this thread

    Top Bottom