Delayed jobs never go back to the 'reserved' state in beanstalkd

This is not a question, but the solution to a problem I had with no (good) solution to be found on google – so I’m just posting this in case anyone runs into the same problem

In beanstalk 1.4.6 (which is the apt-get default version at this moment) on Ubuntu (and probably all Debian derivatives) when you put a job in the tube with a delay time it doesn’t “come out” after the specified delay but rather stays there for ever and ever until you add a new delayed job to the job; in that case the job that was already there will go to ‘reserved’ and the new job will stay there for ever and ever.

The solution is to remove beanstalkd with apt-get (1) and then reinstall beanstalkd 1.5.x from source. This version doesn’t have this problem and works as intended.

cd /usr/local/src
tar zxvf beanstalkd-1.5.tar.gz
cd beanstalkd-1.5
sudo make install

to verify where it was installed

which beanstalkd

(most likely in /usr/bin/beanstalkd)

Hope this helps anyone :slight_smile:

small If you want you can leave the default beanstalkd from Ubuntu installed and just change the /etc/init.d/beanstalkd file to point to the new executable so it will still boot at runtime (or write your own – but this is simpler ;))[/small]

Thanks ScallioXTX,

I ran into this a while ago, and your solution is a good one.