When mass indexing, wait for ID producing threads to finish


Currently we are only waiting on indexing threads.

Obviously those would never finish before the identifier producing threads are done producing but they could finish between the end of the identifier production and the time where the ID producing threads were actually done with some finalizing tasks.

This can result in some failure notifications to be pushed to the failure handler after startAndWait() returned, which can be annoying in some cases (mostly tests).

Reasons for this change:

  1. This won't impact performance much: when indexing threads finish, ID producing threads are mostly done anyway (worst case they still need to report an exception, but that's all).

  2. We will now wait for all threads to finish reporting errors before we consider indexing successful.

  3. We will now propagate exceptions thrown by ID producing threads to the caller of massIndexer.startAndWait(), instead of considering indexing successful.




Yoann Rodière


Yoann Rodière