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

Handle RabbitMQ disconnects #120

Merged
merged 1 commit into from
Jul 26, 2017
Merged

Conversation

xarg
Copy link
Contributor

@xarg xarg commented Jul 26, 2017

⚠️ Not ready to merge, please read below

Relates to #100

Features:

Unresolved issues:

  • Since in production environment the exchange and the queues are already declared as durable/non-durable - how can we redeclare them as durable? Is there a way to migrate them? If I just change the durability i get this error: PreconditionFailed: Exchange.declare: (406) PRECONDITION_FAILED - inequivalent arg 'durable' for exchange
  • How do I test this?

@miguelgrinberg
Copy link
Owner

The issue you referenced contains the following statement:

So if you have a non-durable Exchange with some durable Queues attached to it then after restart it's just hangs there zombie like, not able to accept any new consumers

Have you considered making the queues non-durable instead? Doesn't that also solve the issue, without creating durable resources that will then have to be cleaned up by hand if you are just running a quick test?

@xarg
Copy link
Contributor Author

xarg commented Jul 26, 2017

I just tried making queues non-durable and it worked as expected.

@miguelgrinberg
Copy link
Owner

@xarg Awesome. Thank you so much!

@miguelgrinberg miguelgrinberg merged commit 358a8e1 into miguelgrinberg:master Jul 26, 2017
@xarg
Copy link
Contributor Author

xarg commented Jul 26, 2017

Thanks for being responsive. I would like add some tests for this as well. I'm not familiar with Travis that much, but does it offer a RMQ server or something?

@miguelgrinberg
Copy link
Owner

The tests that I currently have on this repository are all unit tests, they do not have access to any real services, they mock the actual services to test that the code does the right thing. Travis does not provide anything to my knowledge, it would be a somewhat large effort to set up a system to run integration tests, at this point, and will likely incur in hosting costs for me, so I keep things limited to unit tests. If you would like to investigate mocking RabbitMQ to test this code, I would gladly accept that.

@xarg
Copy link
Contributor Author

xarg commented Jul 26, 2017

Got it. Do you think this one is included in the free plan? https://docs.travis-ci.com/user/database-setup/#RabbitMQ

If it's free, would you be open to integrations tests or still want to keep it simple with unittest mocking?

@miguelgrinberg
Copy link
Owner

Sure. I think there is quite a bit of work to set them up, but it would be good to have them, not only for RabbitMQ but for testing the package in general. Sounds like travis could provide enough infrastructure to get this done. You can create a new PR in which you edit the .travis.yml file to request those extra services, I think that's all you need to get the travis infrastructure in place.

@xarg
Copy link
Contributor Author

xarg commented Jul 26, 2017

Alright, I'm gonna do it.

@stuartspotlight
Copy link

Is this related to my issue with publisher disconnects? celery/kombu#857

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

Successfully merging this pull request may close these issues.

None yet

3 participants