Hello,

I've just started using beanstalkd for a project and I'm very excited by 
the possibilities it offers!

I'm a bit confused about the best way to handle a particular situation, so 
was hoping someone could offer me some advice.

Let's say I'm putting jobs into a tube and I have two separate worker 
processes consuming these jobs. I have my TTR for these jobs set at the 
default 120s. However, there's a possibility that a job might stall and 
take longer than this, although ultimately still complete.

In this case, when the TTR expires, the job is automatically released and 
put back into the same tube, where it might be picked up the the second 
worker process. The first worker process still effectively 'has' the job 
though, and, when it eventually completes the work, it will attempt to 
delete the job.

If, in the meantime, the re-queued job has been taken by the second worker, 
we will run into trouble when one of the processes tried to delete the job 
- either, as above, it has already been deleted by the first worker, or the 
second worker completes & deletes the job before the first worker finishes 
it. One or other worker will raise an exception when it tries to delete the 
job.

So, I guess my question is what is the best practise for handling a TTR 
expiration for a long-running, but ultimately successful job? 

Do I just have to spot this in the worker process, and issue a touch to 
reset the TTR and ensure the job is never released and re-queued?

Thanks!

James.

-- 
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/beanstalk-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to