Avoid race condition between index and cleanup operations

Description

An indexing operation for a workflow update can fail to read an episode's dublincore because the mediapackage that the index operation has points to an episode.xml file in the WFR, whereas workflow operations have archived the DC catalog into the archive, and the cleanup operation removes the episode.xml in the WFR:

2017-06-22 13:20:17,082 | DEBUG | pool-63-thread-84 | (WorkingFileRepositoryImpl:173) - Attempting to delete /data/opencast/work/shared/files/mediapackage/b09e1695-cf8b-4412-88f3-df56cec811ca/catalog-0

2017-06-22 13:20:17,099 | ERROR | pool-79-thread-1 | (BaseMessageReceiverImpl$MessageWatcher:148) - Problem while getting org.opencastproject.index.service.message.WorkflowMessageReceiverImpl message events java.io.FileNotFoundException: /data/opencast/work/shared/files/mediapackage/b09e1695-cf8b-4412-88f3-df56cec811ca/catalog-0/episode.xml (No such file or directory)

We can work around this to some extent by adding a configurable delay to the cleanup workflow operation handler (e.g. 5 seconds), to give indexing operations time to read the DC and complete before cleanup removes it.

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Tags (folksonomy)

None

Components

Fix versions

Affects versions

Priority

Major
Configure