[fixed] the runaway recordings just keep coming (1 Viewer)

gibman

Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Yes.

    About your problem.

    Once things go awol.

    Are the recordings still active on the disk ?
    Meaning, are they increasing in size ?

    Your problem about tvservice being unresponsive and consuming 100% cpu.
    It seems that the recordingdetail is never removed from the collection _recordingsInProgressList.

    Like:
    _recordingsInProgressList.Remove(recording); //only remove recording from the list, if we are succesfull

    Look at:
    Code:
      private void HandleRecordingList()
        {
          while (true)
          {
            bool removed = false;
            foreach (RecordingDetail recording in _recordingsInProgressList)
            {
              if (!recording.IsRecording)
              {
                StopRecord(recording);
                removed = true;
                break;
              }
            }
    
            if (removed == false)
            {
              return;
            }
          }
        }

    it has a while (true)
    it keeps on iterating the _recordingsInProgressList LIST.
    And it keeps on calling; StopRecord

    In order to avoid the 100% cpu usage, we need to use a Thread.Sleep(100) before calling "StopRecord" in that loop.
    Although this wont stop your main problem, also the logs will still fill up with garbage.

    We need to figure out what goes on in:

    private void StopRecord(RecordingDetail recording)
    ...

    You could try and add a lot more logging in this method.
    Is it a threading issue ?

    /gibman
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    But shouldn't the while break here as it returns:
    Code:
            if (removed == false)
            {
              return;
            }

    I'm still trying to reproduce this at all - till now i wasn't able to reproduce this manually (testing from work without MP client) running 5 records + timeshifting from TV GUI.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    it has a while (true)

    Why we have even such ugly code? The infinite while loop cannot cause any good in that case. It should be enough to iterate the array once and if the recording was not removed there is some failure.

    We should remove that possible infinite loop (who knows why the recording removal is failing... maybe some other thread removes it already). Instead we need to figure out why that removal fails in the first case.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    THANKS!

    Will this patch work against 25233 or do i have to revert 25227 and 25225 before?

    bad question - a simple a look into the patch clears out that it is against 25230 - sorry for bothering you.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    it could take some days until i report back - as i'm still not able to reproduce this manually.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    hi gibman,

    until now no tv-server errors anymore.

    But i get some errors in my clients with SVN 25277.
    "010-03-14 22:43:16.481586 [Info.][MPMain(1)]: TVProgramInfo: Error in Update() - System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
    bei TvPlugin.TVProgramInfo.PopulateListviewWithUpcomingEpisodes(Program lastSelectedProgram)
    bei TvPlugin.TVProgramInfo.Update()"

    "2010-03-14 22:43:42.154055 [Info.][MPMain(1)]: TVProgramInfo: Error in Update() - System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
    bei TvPlugin.TVProgramInfo.PopulateListviewWithUpcomingEpisodes(Program lastSelectedProgram)
    bei TvPlugin.TVProgramInfo.Update()"
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    I'm still getting these errors:
    "2010-03-15 21:20:13.313000 [scheduler thread(9)]: StopRecord - updating record id=858 failed bei Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg)
    bei Gentle.Common.Check.Fail(Exception e, Error error, Object[] args)
    bei Gentle.Common.Check.Verify(Boolean condition, Error error, Object[] args)
    bei Gentle.Framework.PersistenceBroker.Retrieve(Type type, Key key, IDbConnection conn, IDbTransaction tr)
    bei Gentle.Framework.PersistenceBroker.Retrieve(Object obj, Key key, IDbConnection conn, IDbTransaction tr)
    bei Gentle.Framework.Persistent.Refresh()
    bei TvService.Scheduler.ResetRecordingState(RecordingDetail recording)
    2010-03-15 22:20:14.796400 [scheduler thread(9)]: StopRecord - updating record id=859 failed bei Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg)
    bei Gentle.Common.Check.Fail(Exception e, Error error, Object[] args)
    bei Gentle.Common.Check.Verify(Boolean condition, Error error, Object[] args)
    bei Gentle.Framework.PersistenceBroker.Retrieve(Type type, Key key, IDbConnection conn, IDbTransaction tr)
    bei Gentle.Framework.PersistenceBroker.Retrieve(Object obj, Key key, IDbConnection conn, IDbTransaction tr)
    bei Gentle.Framework.Persistent.Refresh()
    bei TvService.Scheduler.ResetRecordingState(RecordingDetail recording)
    "

    Bu tvservice is now still running and does not crash
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    ok -- do u have any records in the DB with ID 858, 859 ?

    If yes: do any of these recordings have their isrecording flag set to true in DB or false ?


    /gibman
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: the runaway recordings just keep coming

    oh damn - i deleted them manually from the recording db while the recording was still running. I've done that cause mp-tvseries catched them and i don't want to have them in both. I really couldn't imagine that MP needs this f... db entry :-( i'm so sorry. At least in the past or before RC1 this was never a problem. So sorry - everything seems to be fine now with your patches.
     

    Users who are viewing this thread

    Top Bottom