beanstalkd / beaneater

The best way to interact with beanstalkd from within Ruby
http://beanstalkd.github.com/beaneater
MIT License
199 stars 43 forks source link

Process! is not propagating Beaneater::NotConnected exception. #67

Open b-sridhar opened 7 years ago

b-sridhar commented 7 years ago

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:

  1. Start beanstalk: beanstalkd -l 192.168.50.21 -p 11300 &
  2. Put messages to the queue.
  3. 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
  4. Stop the beanstalk server.
  5. The consumer is now hung as the process! method keeps retrying considering Beaneater::NotConnected as a StandardError.
b-sridhar commented 7 years ago

@nesquena @nicotaing , Could you please look into this issue?