toastdriven/django-haystack — pull request #1051 by phill-tornroth (2014-08-12 15:05:51+00:00)
Title: #603 - Make building of UnifiedIndex thread-safe.

This is a new pull request open for the issue originally reported at https://github.com/toastdriven/django-haystack/issues/603

The core problem is that when multiple threads end up in `UnifiedIndex.build()` they modify shared state and one or more of them end up throwing an `ImproperlyConfigured` because it looks like a model is unexpectedly already in `self.indexes`.

This PR contains the patch suggested by @raymondbutcher with a unit test that proves the failure and fix.