After DJ dies the log files indicate nothing.
running: ./script/delayed_job status
gives: pid-file for killed process 1143 found (/appPath/tmp/pids/delayed_job.pid), deleting.
delayed_job: no instances running
The strange thing is if I use: ./script/delayed_job run It will run perfectly in the foreground! And never dies.
Tried many versions of delayed_job and mongoid with same results.
Any one know how to debug?
Using:
rails (3.2.7)
delayed_job_mongoid (2.0.0)
mongoid (3.0.3)
delayed_job (3.0.3)
Turns out
delayed_jobwas executing a job causing a segmentation fault, which would kill the delayed_job daemon.After debugging it turns out
Random.rand()will cause a reproducible segmentation fault when run in a daemonized environment. This has to do with initial seeding and setup of the random generator, which apparently does not get handled properly by daemonize.The solution:
Random.new.rand()