librelist archives

« back to archive

Timeout en thinking-sphinx reindex

Timeout en thinking-sphinx reindex

From:
TuteC
Date:
2011-04-21 @ 06:22
La última pregunta sobre indexadores me recordó de un problema que a
veces tengo al reindexar con Thinking Sphinx en un proyecto. (Con
Tute(.unique) parecemos esquizofrénicos!)
El problema es un timeout al regenerar el índice que ocurre a veces:


$ rake ts:rebuild RAILS_ENV=production
rake aborted!
execution expired

(See full trace by running task with --trace)


Con --trace:

$ rake ts:rebuild RAILS_ENV=production --trace
** Invoke ts:rebuild (first_time)
** Invoke thinking_sphinx:rebuild (first_time)
** Invoke thinking_sphinx:app_env (first_time)
** Execute thinking_sphinx:app_env
** Execute thinking_sphinx:rebuild
** Invoke thinking_sphinx:stop (first_time)
** Invoke thinking_sphinx:app_env
** Execute thinking_sphinx:stop
rake aborted!
execution expired
/usr/lib/ruby/1.8/timeout.rb:60
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:53
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:92
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/


Ocurre tanto en un VPS como en mi compu personal. Estoy usando rails
3.0.6 y thinking-sphinx 2.0.2. A alguien le pasó, o sabe qué puede
estar pasando?

Muchas gracias,

Tute(C).

Re: [rubysur] Timeout en thinking-sphinx reindex

From:
Porta
Date:
2011-04-21 @ 10:27
On Thu, Apr 21, 2011 at 3:22 AM, TuteC <tutecosta@gmail.com> wrote:

> La última pregunta sobre indexadores me recordó de un problema que a
> veces tengo al reindexar con Thinking Sphinx en un proyecto. (Con
> Tute(.unique) parecemos esquizofrénicos!)
> El problema es un timeout al regenerar el índice que ocurre a veces:
>
>
> $ rake ts:rebuild RAILS_ENV=production
> rake aborted!
> execution expired
>
> (See full trace by running task with --trace)
>
>
> Con --trace:
>
> $ rake ts:rebuild RAILS_ENV=production --trace
> ** Invoke ts:rebuild (first_time)
> ** Invoke thinking_sphinx:rebuild (first_time)
> ** Invoke thinking_sphinx:app_env (first_time)
> ** Execute thinking_sphinx:app_env
> ** Execute thinking_sphinx:rebuild
> ** Invoke thinking_sphinx:stop (first_time)
> ** Invoke thinking_sphinx:app_env
> ** Execute thinking_sphinx:stop
> rake aborted!
> execution expired
> /usr/lib/ruby/1.8/timeout.rb:60
>
> 
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:53
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> `invoke_with_call_chain'
> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> `invoke_with_call_chain'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
>
> 
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:92
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> `invoke_with_call_chain'
> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> `invoke_with_call_chain'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
> `invoke_prerequisites'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
> `invoke_prerequisites'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
> `invoke_with_call_chain'
> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> `invoke_with_call_chain'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
> /usr/lib/ruby/
>
>
> Ocurre tanto en un VPS como en mi compu personal. Estoy usando rails
> 3.0.6 y thinking-sphinx 2.0.2. A alguien le pasó, o sabe qué puede
> estar pasando?
>
> Muchas gracias,
>
> Tute(C).
>

Por ahi es una pavada, pero ojo que rebuild y reindex no son lo mismo.
Rebuild frena sphinx, regenera la configuracion, actualiza indices y arranca
de nuevo sphinx, mientras que reindex no toca la config ni a sphinx, solo
reindexa.
Acá se ve clarito:

http://github.com/freelancing-god/thinking-sphinx/blob/master/lib/thinking_sphinx/tasks.rb#L89<https://github.com/freelancing-god/thinking-sphinx/blob/master/lib/thinking_sphinx/tasks.rb#L89>

Por ahi el timeout lo tenés en realidad al hacer el stop y start de sphinx,
y no tenga nada que ver con la parte de reindexar.
Me ha pasado alguna vez con cron jobs de ver timeouts al reiniciar sphinx.

Espero que sirva.

Porta.

Re: [rubysur] Timeout en thinking-sphinx reindex

From:
TuteC
Date:
2011-04-21 @ 17:37
2011/4/21 Porta <julian.porta@gmail.com>:
> On Thu, Apr 21, 2011 at 3:22 AM, TuteC <tutecosta@gmail.com> wrote:
>>
>> La última pregunta sobre indexadores me recordó de un problema que a
>> veces tengo al reindexar con Thinking Sphinx en un proyecto. (Con
>> Tute(.unique) parecemos esquizofrénicos!)
>> El problema es un timeout al regenerar el índice que ocurre a veces:
>>
>>
>> $ rake ts:rebuild RAILS_ENV=production
>> rake aborted!
>> execution expired
>>
>> (See full trace by running task with --trace)
>>
>>
>> Con --trace:
>>
>> $ rake ts:rebuild RAILS_ENV=production --trace
>> ** Invoke ts:rebuild (first_time)
>> ** Invoke thinking_sphinx:rebuild (first_time)
>> ** Invoke thinking_sphinx:app_env (first_time)
>> ** Execute thinking_sphinx:app_env
>> ** Execute thinking_sphinx:rebuild
>> ** Invoke thinking_sphinx:stop (first_time)
>> ** Invoke thinking_sphinx:app_env
>> ** Execute thinking_sphinx:stop
>> rake aborted!
>> execution expired
>> /usr/lib/ruby/1.8/timeout.rb:60
>>
>> 
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:53
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
>>
>> 
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-2.0.2/lib/thinking_sphinx/tasks.rb:92
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
>> `invoke_prerequisites'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
>> `invoke_prerequisites'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
>> `invoke_with_call_chain'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
>> /usr/lib/ruby/
>>
>>
>> Ocurre tanto en un VPS como en mi compu personal. Estoy usando rails
>> 3.0.6 y thinking-sphinx 2.0.2. A alguien le pasó, o sabe qué puede
>> estar pasando?
>>
>> Muchas gracias,
>>
>> Tute(C).
>
> Por ahi es una pavada, pero ojo que rebuild y reindex no son lo mismo.
> Rebuild frena sphinx, regenera la configuracion, actualiza indices y arranca
> de nuevo sphinx, mientras que reindex no toca la config ni a sphinx, solo
> reindexa.
> Acá se ve clarito:
> 
http://github.com/freelancing-god/thinking-sphinx/blob/master/lib/thinking_sphinx/tasks.rb#L89
> Por ahi el timeout lo tenés en realidad al hacer el stop y start de sphinx,
> y no tenga nada que ver con la parte de reindexar.
> Me ha pasado alguna vez con cron jobs de ver timeouts al reiniciar sphinx.
> Espero que sirva.
> Porta.

Efectivamente el problema estaba al detener Sphinx. Maté al proceso, y
rebuild (y reindex, gracias por la distinción!) anduvo bien.

Gracias!