Resque: rake resque: el trabajo aborta el inicio si el primer trabajo genera un error constante no inicializado

Creado en 17 abr. 2013  ·  11Comentarios  ·  Fuente: resque/resque

AFAIK, esto fue algo que cambió de 1.23.0 a 1.24.1. Me imagino que el comportamiento previsto aquí, dada la arquitectura de bifurcación de resque, sería que el proceso principal continúe ejecutándose, coloque el trabajo en la cola de fallas y pase al siguiente. Además, no estamos usando la nueva configuración de "no bifurcar" agregada en versiones recientes.

Bug Hard

Comentario más útil

¿Alguna solución para esto?

Todos 11 comentarios

Aquí está el rastro de retroceso:

→ VVERBOSE=1 QUEUE=* bundle exec ./bin/rake environment resque:work
** [02:52:25 2013-04-17] 30473: Starting worker 12-345-67-890:1234:*
** [02:52:25 2013-04-17] 30473: Registered signals
** [02:52:25 2013-04-17] 30473: Pruning dead worker: 12-345-67-890:2345:*
** [02:52:25 2013-04-17] 30473: Failed to start worker : #<NameError: uninitialized constant JobClassThatNoLongerExists>

[GEM_ROOT]/gems/resque-1.24.1/lib/resque/helpers.rb:88:in `block in constantize`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/helpers.rb:82:in `each`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/helpers.rb:82:in `constantize`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/job.rb:166:in `payload_class`
[GEM_ROOT]/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/instrumentation/resque.rb:49:in `payload_class`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/job.rb:217:in `failure_hooks`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/job.rb:223:in `run_failure_hooks`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/job.rb:177:in `fail`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/worker.rb:464:in `unregister_worker`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/worker.rb:176:in `rescue in work`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/worker.rb:130:in `work`
[GEM_ROOT]/gems/resque-1.24.1/lib/resque/tasks.rb:41:in `block (2 levels) in <top (required)>`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:228:in `call`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:223:in `each`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain`
/home/deploy/.rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:101:in `each`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling`
[GEM_ROOT]/gems/rake-10.0.3/lib/rake/application.rb:70:in `run`
[GEM_ROOT]/gems/rake-10.0.3/bin/rake:33:in `<top (required)>`
/var/www/payments/current/bin/rake:16:in `load`
/var/www/payments/current/bin/rake:16:in `<main>`

Sí, esto no debería matar al trabajador, seguro.

Solo actualizando este ticket, vale la pena mencionar que este fue un trabajo proveniente de resque-Scheduler. No estoy seguro de si la ruta del código es diferente allí, pero estoy tratando de escribir una especificación que lo demuestre de una forma u otra.

Genial gracias.

Tengo el mismo problema, ¿cómo puedo evitarlo?

También publiqué la pregunta aquí:
http://stackoverflow.com/questions/16802948/ignoring-unregister-worker-in-resque

Viendo esto también. No hay seguimiento, por lo que es difícil rastrear por qué hay un error #<NameError: uninitialized constant MyConstant> en el trabajo. Esto es todo lo que veo:

** Invoke environment (first_time)
** Execute environment
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Execute resque:setup
** Execute resque:preload
** Invoke resque:setup
** Execute resque:work
*** Starting worker job21:8278:job_name
*** Registered signals
*** Pruning dead worker: job21:6807:job_queue
*** Failed to start worker : #<NameError: uninitialized constant MyConstant>

¿Alguna solución para esto?

Tengo una solución para el NameError mata al padre, pero primero quiero intentar encontrar una manera de reproducir este problema para poder asegurarme de que realmente lo resuelve. ¿Es correcto decir que el problema se puede reproducir poniendo en cola un trabajo con una clase que no existe?

Yo tengo el mismo problema. ¿Alguna solución para NameError?

Como dije, creo que tengo una solución, pero primero me gustaría poder recrear el problema de manera confiable.

Estoy frente a la misma cuestión que la clase no se encuentra, estoy utilizando el Programador de Contentful https://github.com/contentful/contentful-scheduler.rb para publicar y contenido despublicación y sólo mientras dejar de publicar contenidos que consigo este error al azar

constante no inicializada Contentful :: Scheduler :: Tasks :: Unpublish ¿Quiso decir? Contentful :: Programador :: Tareas :: Publicar
/root/.gem/ruby/gems/resque-1.27.4/lib/resque.rb:96:in block in constantize' /root/.gem/ruby/gems/resque-1.27.4/lib/resque.rb:90:in cada '
/root/.gem/ruby/gems/resque-1.27.4/lib/resque.rb:90:in `constantize '

¿Fue útil esta página
0 / 5 - 0 calificaciones