Skip to content

Added resiliency to RabbitMQ transport#52

Merged
josegonzalez merged 3 commits into
python-beaver:masterfrom
rafaelmagu:master
Nov 28, 2012
Merged

Added resiliency to RabbitMQ transport#52
josegonzalez merged 3 commits into
python-beaver:masterfrom
rafaelmagu:master

Conversation

@rafaelmagu
Copy link
Copy Markdown

As per comments in #51, this PR includes some code to better handle connection dropouts as well as buffer warnings from the Pika library. It also includes exponential backoff for respawning the worker.

I've implemented a TransportException class to help with trapping specific transport errors. This can be extended for use in other transports as well, and the respawn code should pick it up correctly.

Comment thread bin/beaver
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't perma-fail?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in my tests. It just limits the amount of time for the respawn to occur to a sensible level.

Maximum time for a respawn = 2187 seconds.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about maximum retries?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't thought of adding that. It's an option. Logstash agent doesn't fail when it can't connect, so I just coded the same behavior.

@josegonzalez
Copy link
Copy Markdown
Member

Can you move the retry logic into somewhere else? I meant the binary to be an argparser and a Worker runner, and nothing else. This is overstepping the boundaries of what I think it should be.

@rafaelmagu
Copy link
Copy Markdown
Author

I'm not sure how to respawn the worker from itself, though. The binary spins up the worker. If you had a dispatch class, we could do it there.

@josegonzalez
Copy link
Copy Markdown
Member

Make a dispatch class then.

@rafaelmagu
Copy link
Copy Markdown
Author

Eventually, sure. For now, this suits my needs. Just thought I'd share. :)

josegonzalez pushed a commit that referenced this pull request Nov 28, 2012
Added resiliency to RabbitMQ transport
@josegonzalez josegonzalez merged commit 01f080d into python-beaver:master Nov 28, 2012
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.

2 participants