[mythtv-commits] Ticket #12046: Fix random SBE PlaybackSock timeout in MBE

MythTV noreply at mythtv.org
Mon Feb 3 20:28:50 UTC 2014


#12046: Fix random SBE PlaybackSock timeout in MBE
-------------------------------------+-------------------------------------
     Reporter:  Cédric Schieli       |      Owner:
  <cschieli@…>                       |     Status:  new
         Type:  Patch - Bug Fix      |  Milestone:  unknown
     Priority:  major                |    Version:  0.27-fixes
    Component:  MythTV - General     |   Keywords:  SBE PlaybackSock
     Severity:  medium               |  timeout
Ticket locked:  0                    |
-------------------------------------+-------------------------------------
 SBE PlaybackSocks in the master suffer from random disconnection, occuring
 after a 7000 ms timeout. It often happens when a frontend ask for the
 thumbnail of a program currently being recorded on a slave backend.

 I could identify two problems causing this:

 First, there is a race between MainServer::ProcessRequestWork and
 PlaybackSock::SendReceiveStringList. Even if callbacks are disabled during
 SendReceiveStringList execution, a ProcessRequestWork may already be
 running
 and can swallow the reply, leading to the timeout in
 SendReceiveStringList.

 The second problem is that an invocation of ProcessRequestWork is fired
 for
 each block of data arriving in the socket (for example when a reply is
 long
 enough to be fragmented, ie. GENERATED_PIXMAP) but this data is consumed
 all at
 once by one worker, leaving the other workers without food. This also
 leads to
 the timeout in ReadStringList.

 This patch fixes the first problem by assuring that no worker reads from
 the
 socket while a SendReceiveStringList is running and the second one by
 aborting
 a worker if there is no more data to read, but only once the lock has been
 acquired.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12046>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list