aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
606 stars 269 forks source link

Fix a race condition on index' doc count retrieval #402

Closed brunal closed 10 years ago

brunal commented 10 years ago

managers.Indices.get_indices() could fail (and raise a KeyError) upon reading the 'num_docs' of an index just created. Catching the exception and setting the 'num_docs' to 0 (which is the actual value) fixes the problem.

This fixes issue #401.