[mythtv-commits] Ticket #12602: lossless transcode that fills the disk loses the tail of the recording

MythTV noreply at mythtv.org
Wed Jan 13 08:00:02 UTC 2016


#12602: lossless transcode that fills the disk loses the tail of the recording
------------------------------------------+---------------------------
 Reporter:  Timothy D Witham <twitham@…>  |          Owner:  jyavenard
     Type:  Bug Report - General          |         Status:  new
 Priority:  minor                         |      Milestone:  unknown
Component:  MythTV - Mythtranscode        |        Version:  0.27.5
 Severity:  medium                        |     Resolution:
 Keywords:  disk full transcode truncate  |  Ticket locked:  0
------------------------------------------+---------------------------

Comment (by Timothy D Witham <twitham@…>):

 Sorry, my assumption is that close is more likely to fail on full disk,
 even though the write just succeeded.  I have seen this happen in
 completely unrelated code in other projects.  Close may cause the OS to
 actually flush pending data to disk while write just buffers it into
 memory successfully.

 Then, if close() fails, my expectation would be that instead of rename
 .mpg.tmp over the original .mpg, mythtv would instead log the error and
 remove the truncated .mpg.tmp transcode.

 If you are right that close also succeeds, then we could get even more
 serious with fsync(2).  Again from close(2):

 {{{
         A successful close does not guarantee that the data has been
         successfully saved to disk, as the kernel defers writes.  It
         is not  common for a file  system to flush  the buffers when
         the stream is closed.  If you  need to be sure that the data
         is physically  stored use fsync(2).  (It will  depend on the
         disk hardware at this point.)

 }}}

 But that might be overkill if close already detected the full disk.  I'd
 first check close and see if its return is correct.  If fsync is needed,
 hopefully it breaks out with an error instead of blocking which would be
 even worse.  I haven't yet tried any of this since I'm using pre-built
 mythbuntu and haven't yet built it from source.

 Thanks for your quick reply and consideration!

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12602#comment:2>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list