# Possible Timing Problem

**URL:** <https://discuss.elastic.co/t/possible-timing-problem/3030>\
**Category:** Elasticsearch\
**Created:** [June 19, 2010, 1:12am UTC](https://discuss.elastic.co/t/possible-timing-problem/3030 "2010-06-19T01:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [June 19, 2010, 1:12am UTC](https://discuss.elastic.co/t/possible-timing-problem/3030/1 "2010-06-19T01:12:08Z")

</div>

Hi, I think I may have found another timing issue, I occasionally encounter  
an index doesn't exist exception when attempting to index.  
The index doesn't exist that is true but I thought I had read that if it  
doesn't exist it is created and this must be since it is only sometimes I  
see this exception most of the time it works.  
I have encountered this with both local unit testing and connecting to a  
running instance.  
Comes from: IndexResponse indexResponse =  
client.index(indexRequest).actionGet()

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 19, 2010, 9:30pm UTC](https://discuss.elastic.co/t/possible-timing-problem/3030/2 "2010-06-19T21:30:22Z")

</div>

There is probably a timing issue here, can you open an issue and lets see if  
I can recreate this to fix it...

-shay.banon

On Sat, Jun 19, 2010 at 4:12 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> Hi, I think I may have found another timing issue, I occasionally  
> encounter an index doesn't exist exception when attempting to index.  
> The index doesn't exist that is true but I thought I had read that if it  
> doesn't exist it is created and this must be since it is only sometimes I  
> see this exception most of the time it works.  
> I have encountered this with both local unit testing and connecting to a  
> running instance.  
> Comes from: IndexResponse indexResponse =  
> client.index(indexRequest).actionGet()

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [June 19, 2010, 10:19pm UTC](https://discuss.elastic.co/t/possible-timing-problem/3030/3 "2010-06-19T22:19:44Z")

</div>

I have also seen this, but just assumed it was a side effect of eventually  
consistent.

A workaround I have is to poll, using the admin client doing a  
indices.status request, in a loop and wait until the index appears in the  
list.

Hope that helps!

On Sat, Jun 19, 2010 at 10:30 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> There is probably a timing issue here, can you open an issue and lets see  
> if I can recreate this to fix it...
> 
> -shay.banon
> 
> On Sat, Jun 19, 2010 at 4:12 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > Hi, I think I may have found another timing issue, I occasionally  
> > encounter an index doesn't exist exception when attempting to index.  
> > The index doesn't exist that is true but I thought I had read that if it  
> > doesn't exist it is created and this must be since it is only sometimes I  
> > see this exception most of the time it works.  
> > I have encountered this with both local unit testing and connecting to a  
> > running instance.  
> > Comes from: IndexResponse indexResponse =  
> > client.index(indexRequest).actionGet()

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://www.keteracel.com/paul](http://www.keteracel.com/paul)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:23am UTC](https://discuss.elastic.co/t/possible-timing-problem/3030/4 "2017-07-06T04:23:11Z")

</div>


