The WFR put() method in WorkingFileRepositoryImpl will first delete any files in the mediapackage element directory, then upload the given file.
This can lead to race conditions when a workflow operation is updating the episode.xml file. The workflow operation puts a new version of episode.xml while an indexing thread is attempting to read it. For a short window of time, the file is unavailable.
Change the put method to handle the case where a file is being updated by writing the new file to a temporary file name, then moving the temporary file to the real file atomically.