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

Race condition make managers.Indices.get_indices() fail #401

Closed brunal closed 10 years ago

brunal commented 10 years ago

managers.Indices.get_indices() can fail when trying to read an index' doc count if that index just got created.

Here is the bottom of a sample stack trace:

indices = self.es_client.indices.get_indices() File "/var/www/statistic/current/venv/lib/python2.7/site-packages/pyes/managers.py", line 221, in get_indices num_docs = info['docs']['num_docs'] KeyError: 'docs'