bkeepers / qu

a Ruby library for queuing and processing background jobs.
MIT License
505 stars 50 forks source link

Redis jobs not being cleaned out properly #21

Closed fbjork closed 12 years ago

fbjork commented 12 years ago

Hi,

I'm using the latest version of Qu. When I check each queue length it says zero. However when I list keys * in Redis I get this: https://gist.github.com/6ed74e94daccf4cfa0ff

Any ideas?

This is on Heroku.

bkeepers commented 12 years ago

Do you have any failed jobs? Qu.length('failed')

Qu should clear out the jobs that are completed: https://github.com/bkeepers/qu/blob/master/lib/qu/backend/redis.rb#L67-69

fbjork commented 12 years ago

Ah there you go. Lots of failed jobs. Anyway of inspecting failed jobs without going into redis-cli?

fbjork commented 12 years ago

What determines if a job failed?

fbjork commented 12 years ago

When I did: Qu.clear(:failed), Qu.length(:failed) returns 0, but keys * in redis-cli still shows thousands of qu keys. Ideas? Looks like jobs aren't being removed from Redis properly?

bkeepers commented 12 years ago

Failed jobs are ones that raised an exception. There isn't currently a way to inspect the errors through qu. I've been using qu-exceptional to report them to http://getexceptional.com, so I haven't had the need for other ways of inspecting the errors.

Also, clearing the queue apparently doesn't delete the jobs from redis. That's an oversight on my part. I'll get that fixed.