As mentioned in the title, the process! method does not propagate or break from the while loop when there is Beaneater::NotConnected exception i.e when the Beanstalkd goes down.
Steps to reproduce:
- Start beanstalk:
beanstalkd -l 192.168.50.21 -p 11300 &
- Put messages to the queue.
- Start the consumer.
@beanstalk = Beaneater.new('192.168.50.21:11300')
begin
@beanstalk.jobs.register('my-tube') do |job|
puts "Job: #{job.inspect}"
end
@beanstalk.jobs.process!({:reserve_timeout => 10})
rescue Exception => e
puts "Exception: #{e.inspect}"
@beanstalk.close
end
- Stop the beanstalk server.
- The consumer is now hung as the process! method keeps retrying considering Beaneater::NotConnected as a StandardError.