Commit ab5abfa4 authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

RecordReader: Simplify interface contract and implementation.

Prior to this change, RecordReader had the following contract:
- Records can be read in any order, EXCEPT if compression or buffering was
  enabled.
- If the underlying file is being concurrently written to
  then calls to ReadRecord() may fail (because of an incomplete
  record near the end of a file), but a retry may succeed (once the
  record is written), EXCEPT if compression or buffering is enabled
  (in which case the failure will be terminal).

  This "retry-may-succeed" behavior is relied upon by tensorboard
  (https://github.com/tensorflow/tensorboard/blob/1.7/tensorboard/backend/event_processing/event_file_loader.py#L55)
  where one process (typically the model training process) is writing
  tf.summary events to an event file and another process (tensorboard)
  is concurrently reading it.

With this change, the intent is to remove the EXCEPTions and have the
same behavior irrespective of compression/buffering.

Additionally, fix a memory leak when ZlibInputStream::Reset() is invoked.

PiperOrigin-RevId: 193571934
parent 1e7289fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment