We're using pybeanstalk 0.11.1, python 2.6.5, Ubuntu 10.04.3 LTS. The main loop of our multi-threaded beanstalk client looks like:
Every once in a while (yesterday it happened once in 60k jobs processed), the delete() call in the finally block raises a NotFound exception. I've included a stack dump below.
2012-04-02T04:56:57+00:00 cluster1.songza.com 2012-04-02 04:56:57,497 - scrobble_mill - Caught NotFound('Server returned: NOT_FOUND',) in <Thread(Thread-9, started 139969929115392)> Traceback (most recent call last):
File "/home/songza/deploy/current/scrobble/scrobble_mill.py", line 98, in listen_wrapper
listen(host, port)
File "/home/songza/deploy/current/scrobble/scrobble_mill.py", line 162, in listen
mq.delete(jid)
File "/usr/lib/pymodules/python2.6/beanstalk/serverconn.py", line 94, in caller
*getattr(protohandler, 'process_%s' % attr)(*args, **kw))
File "/usr/lib/pymodules/python2.6/beanstalk/serverconn.py", line 68, in _do_interaction
return self._get_response(handler)
File "/usr/lib/pymodules/python2.6/beanstalk/serverconn.py", line 58, in _get_response
res = handler(recv)
File "/usr/lib/pymodules/python2.6/beanstalk/protohandler.py", line 56, in __call__
return self.__h(val)
File "/usr/lib/pymodules/python2.6/beanstalk/protohandler.py", line 68, in handler
checkError(response)
File "/usr/lib/pymodules/python2.6/beanstalk/errors.py", line 35, in checkError
raise err
NotFound: Server returned: NOT_FOUND