Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reject! cause hutch worker to shutdown #175

Closed
gottfrois opened this issue Oct 15, 2015 · 2 comments
Closed

reject! cause hutch worker to shutdown #175

gottfrois opened this issue Oct 15, 2015 · 2 comments

Comments

@gottfrois
Copy link
Contributor

Any idea why reject! kill the worker? Am I missing something?

module Consumers
  class Test
    include ::Hutch::Consumer

    consume 'test'

    def process(response)
      reject!
    end
  end
end
2015-10-15T14:47:27Z 34520 INFO -- hutch booted with pid 34520
2015-10-15T14:47:27Z 34520 INFO -- found rails project (.), booting app
2015-10-15T14:47:43Z 34520 INFO -- connecting to rabbitmq (amqp://[email protected]:5672/immvnaiq)
2015-10-15T14:47:43Z 34520 INFO -- connected to RabbitMQ at 127.0.0.1 as immvnaiq
2015-10-15T14:47:43Z 34520 INFO -- opening rabbitmq channel with pool size 1
2015-10-15T14:47:43Z 34520 INFO -- using topic exchange 'textmaster'
2015-10-15T14:47:43Z 34520 INFO -- HTTP API use is disabled
2015-10-15T14:47:43Z 34520 INFO -- tracing is disabled
2015-10-15T14:47:43Z 34520 INFO -- setting up queues
2015-10-15T14:48:35Z 34520 INFO -- message(278fc81e-f7a8-4655-b398-faed1a049cca): routing key: test, consumer: Consumers::Test, payload: {}
2015-10-15T14:48:35Z 34520 INFO -- hutch shut down gracefully

Rabbitmq logs:

=INFO REPORT==== 15-Oct-2015::16:51:18 ===
accepting AMQP connection <0.14570.0> (127.0.0.1:56974 -> 127.0.0.1:5672)

=ERROR REPORT==== 15-Oct-2015::16:51:18 ===
Channel error on connection <0.14570.0> (127.0.0.1:56974 -> 127.0.0.1:5672, vhost: 'immvnaiq', user: 'immvnaiq'), channel 1:
{amqp_error,precondition_failed,"unknown delivery tag 1",'basic.ack'}

=WARNING REPORT==== 15-Oct-2015::16:51:18 ===
closing AMQP connection <0.14570.0> (127.0.0.1:56974 -> 127.0.0.1:5672):
connection_closed_abruptly
@teodor-pripoae
Copy link
Contributor

I think it is related to #165. You are sending the reject and then the worker sends ack for the same message, causing the connection to drop.

@michaelklishin
Copy link
Member

Yes, the issue here is double acking (or reject-then-ack), which results in a channel-level protocol exception. #165 is indeed aims to solve this problem. See also #177, which has a decent chance at being merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants