views:

453

answers:

2

I've been using delayed_job without issues for a while now; mostly for queuing ActionMailer calls (Notifier.send_later ...). Lately it sends out random multiples of emails from the same job. I'll queue one email and I'll receive it five times, or once, or twice, all at the same time. I've restarted delayed_job and it seems to behave for a bit. Anyone experience this?

This is my log; I've never seen these errors before...

# Logfile created on 2010-02-11 by logger.rb
*** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
#<NameError: uninitialized constant Delayed::Worker>
*** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
#<NoMemoryError: failed to allocate memory>
#<SystemStackError: stack level too deep>
#<fatal: exception reentered>
#<LoadError: no such file to load -- tmail>
#<SystemExit: exit>
#<NameError: uninitialized constant Delayed::Worker::Merb>
#<NameError: uninitialized constant Merb>
#<NameError: uninitialized constant Delayed::Merb>
#<NameError: uninitialized constant Merb>
#<NameError: uninitialized constant Delayed::Merb>
#<NameError: uninitialized constant Delayed::Worker::Merb>
#<NameError: "Gems::DelayedJob-1.8.4::Lib::Delayed::Worker" is not a valid constant name!>
#<NameError: uninitialized constant Delayed::Worker>
A: 

When you deploy a new version of your application, make sure to kill all DJ workers and start up only 1 (or however many you want - start with 1 to debug this issue).

ps -ef | grep delayed_job
Jonathan Julian
A: 

sorry for a question instead of an answer, but I'm having the same log output. any chance you've figured out why? I wonder why would it require Merb?.. and what's that horror all about:

NoMemoryError: failed to allocate memory SystemStackError: stack level too deep fatal: exception reentered

rstets
The issue was that I wasn't in fact killing all DJ workers before I deployed and restarting them afterwards. I never did decipher those log messages!
Matt Darby
ahh. I see. I've set up monit to re-start dj once it dies. couldn't use monit to stop/start dj after deploy (via capistrano) so I just stop dj with script/delayed_job and in a short while monit re-starts it fine. I wonder if DelayedJob requires Merb? Why would it throw name errors about it?
rstets