Race conditions in indexing queue

Fixed in

EPiServer.Find 13.2.8


Jun 18, 2019


Aug 10, 2020


Closed, Fixed and tested


It is not uncommon that clients complain about pages that are not updated through event indexing. We can often see that an indexing is performed but not with the latest version.

The App Support team has two possible theories on why this happens. One is described here: FIND-4176. The next is described below:

  1. Page A is saved which will add an item to the indexing queue.
  2. The queue is polled, the objects are retrieved from the db, serialized and pushed to Find. The thread is awaiting a response from Find...
  3. Meanwhile, page A is published and another item is added to the queue (it will have the same hash).
  4. A 200 OK is returned from Find, the indexing queue synchronize and purges the queue from all items with the same hash as A. The new published state will never be handled.

This typically happens when stuff is done in event handlers that slow up the process which creates a "perfect time gap".

Possible fixes

  1. Don't delete items from the queue that was added after the last LoadItems was performed.
  2. Only add content to the queue if either the content version that triggered the event has VersionStatus. Published or no version of the content is published.