Which job issues DEADLINE_SOON

47 views
Skip to first unread message

azhol...@gmail.com

unread,
Jan 17, 2017, 2:02:06 AM1/17/17
to beanstalk-talk
Hi,

Is there a way to tell which job issued a DEADLINE_SOON response?
In a single-worker scenario, this is obvious, but if I use a multi-threaded client to reserve (and process) long-running jobs I don't see a way of telling which job issues a DEADLINE_SOON response.

Or am I missing something?

Thanks

Michael Barrow

unread,
Jan 17, 2017, 3:01:25 AM1/17/17
to beansta...@googlegroups.com
The only thoughts I have:
  1. stat the jobs and keep track of how long you've had them reserved so you can have a general idea of which one gave you the deadline soon.
  2. Keep touching them within your processing loop to ensure they don't get taken away from you.

The proto doc seems to indicate that #2 might be the right way to go:
The "touch" command allows a worker to request more time to work on a job.
This is useful for jobs that potentially take a long time, but you still want
the benefits of a TTR pulling a job away from an unresponsive worker.  A worker
may periodically tell the server that it's still alive and processing a job
(e.g. it may do this on DEADLINE_SOON). The command postpones the auto
release of a reserved job until TTR seconds from when the command is issued.

That's my $0.02....


michael at barrow dot me

"Do not anticipate trouble, or
worry about what may never happen.
Keep in the sunlight." -- B. Franklin

--
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 beanstalk-talk+unsubscribe@googlegroups.com.
To post to this group, send email to beanstalk-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/beanstalk-talk.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages