Problem with resque; parent process doesn't die

I am facing problem in resque process. I have following implementation:

/config/resque_schedule.yml

add_jobs_to_queue:
cron: “15 * * * *”
class: FooJob
description: “Find results from class Bar and put on queue”

/app/jobs/foo_job.rb

class FooJob
@queue = :normal

def self.perform
Bar.add_jobs
end
end

app/models/bar.rb

class Bar
def self.add_jobs
students = find :all
students.each { |student| student.enqueue(:asap) }
end
end

Here FooJob(queue: normal) is executed using resque scheduler. The
performmethod in FooJob calls method
add_jobs from class Bar. In this method, results are found, and put one
by
one on queue asap. So FooJob becomes parent process, and execution of
‘student’ becomes child process. So there should be 2 running processes
in
the system when this executes. When execution overs, both processes
should
die automatically. My problem is, the parent process doesn’t die though
child process has finished execution.

‘ps aux | grep resque’ shows following result on my machine:

root 7205 0.0 0.7 228012 122920 ? Ss Apr13 0:21 resque-1.13.0: Forked
12933 at 1302843615

Here it states that process 7205 has forked process 12933, but I don’t
see
process 12933 running in the system(means it has finished execution)

What should be problem with parent process doesn’t die? What is solution
on
this?

Thanks in advance.

What if I explicitly exit process(using Process.exit(0)) in
FooJob#perform
after line Bar.add_jobs?

On Mon, Apr 18, 2011 at 12:37 AM, Nilesh [email protected]
wrote:

What if I explicitly exit process(using Process.exit(0)) in FooJob#perform
after line Bar.add_jobs?

No as that will kill your child processes as they start. You should take
a
look at Parents and Children as well as the Signals section of the
Resque
README. It discusses using a QUIT signal to shut down idle processes. It
also talks about checking to see what that process is doing in queue.

B.