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

Add conn shutdown error log. Improve other error log messages #33

Closed

Conversation

andrewvc
Copy link
Contributor

Previously, if a connection died it would recover, but there would be no indication of an error. This was a problem in logstash-plugins/logstash-input-rabbitmq#76

Including the URL will help users debug things.

@andrewvc andrewvc self-assigned this Oct 26, 2016
end
connection.on_blocked do
@logger.warn("RabbitMQ connection blocked! Check your RabbitMQ instance!",
:url => connection_url(connection))
Copy link
Contributor

Choose a reason for hiding this comment

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

are we sure this (connection) does not log any auth information?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see masking is done below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def connection_url(connection)
user_pass = connection.user ? "#{connection.user}:XXXXXX@" : ""
protocol = params["ssl"] ? "amqps" : "amqp"
"#{protocol}://#{user_pass}#{connection.host}:#{connection.port}#{connection.vhost}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see this here. Ignore my comment above

:url => connection_url(connection))
end
connection.on_unblocked do
@logger.warn("RabbitMQ connection unblocked!", :url => connection_url(connection))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this info?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been warn for a long time. I think it is something that is warning level, normally queues should not be blocked unless there's a problem.

@suyograo
Copy link
Contributor

LGTM

@elasticsearch-bot
Copy link

Andrew Cholakian merged this into the following branches!

Branch Commits
master e021f49

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

Successfully merging this pull request may close these issues.

None yet

3 participants