# Reindex and timeout (was: Reindexing and chef-client)

**URL:** https://discourse.chef.io/t/reindex-and-timeout-was-reindexing-and-chef-client/2500
**Category:** Chef Infra (archive)
**Created:** [February 24, 2012, 8:40pm UTC](https://discourse.chef.io/t/reindex-and-timeout-was-reindexing-and-chef-client/2500 "2012-02-24T20:40:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KC\_Braunschweig](https://avatars.discourse-cdn.com/v4/letter/k/ea5d25/32.png) [@KC\_Braunschweig](https://discourse.chef.io/u/KC_Braunschweig)
#### Post date: [February 24, 2012, 8:40pm UTC](https://discourse.chef.io/t/reindex-and-timeout-was-reindexing-and-chef-client/2500/1 "2012-02-24T20:40:11Z")

</div>

This reminded me of a problem I had. Wondering if it is common. I had  
to do an index rebuild and the knife command kept timing out because  
the rebuild takes a while. I didn't see a way to tell knife to use a  
longer timeout to wait for the response.  
Is there a way?  
Should this not happen?  
Should this be implemented as an async call instead?

Turns out the index rebuild did eventually finish successfully, but I  
could only tell by the results and looking at the server logs. Since  
the rebuild is actually separate calls for each index I'm worried that  
if it gets too long, the later calls might not ever be made and index  
rebuilding would become impossible to complete.

KC

> > > > > On Wednesday, February 22, 2012, Jesse Nelson [spheromak@gmail.com](mailto:spheromak@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > Couple things I can think of:
> > > > > > 
> > > > > > You can block server's API port with iptables. Causing node client  
> > > > > > runs to fail, but not change anything.
> > > > > > 
> > > > > > Add to all nodes runlist in the front a recipe that simply ends the  
> > > > > > run with node.exit. Till you're done with your upgrade of course.
> > > > > > 
> > > > > > Knife ssh disable all your clients 🙂
> > > > > > 
> > > > > > I am sure there are more!

---

<div class="post-metadata">

### Author: ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)
#### Post date: [February 29, 2012, 4:55pm UTC](https://discourse.chef.io/t/reindex-and-timeout-was-reindexing-and-chef-client/2500/2 "2012-02-29T16:55:05Z")

</div>

On Friday, February 24, 2012 at 12:40 PM, KC Braunschweig wrote:

> This reminded me of a problem I had. Wondering if it is common. I had  
> to do an index rebuild and the knife command kept timing out because  
> the rebuild takes a while. I didn't see a way to tell knife to use a  
> longer timeout to wait for the response.  
> Is there a way?  
> Should this not happen?  
> Should this be implemented as an async call instead?

If it was async, there's a greater chance it would fail without you knowing about it. I could see the value in creating some sort of background job document and polling for the status, but that's a pretty large leap in complexity.

If you want to increase your timeout, the setting is `rest_timeout` which defaults to 300s.

--  
Dan DeLeo
