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 super-read-only the same way as read-only errors #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dougfales
Copy link

A small change to include --super-read-only errors in the criteria for deciding to attempt a reconnect.

Copy link
Owner

@alfa-jpn alfa-jpn left a comment

Choose a reason for hiding this comment

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

@dougfales

Sorry for the late reply.

Thanks for great PR!

Please check some comments. 🙏
Also, Can you write a test code?

https://github.com/alfa-jpn/mysql2-aurora/blob/master/spec/mysql2/aurora_spec.rb#L88

@@ -19,6 +19,11 @@ def initialize(opts)
reconnect!
end

def read_only_error?(msg)
Copy link
Owner

Choose a reason for hiding this comment

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

nits: Please write a comment with yard format 🙏

Comment on lines +23 to +24
return false if msg.nil?
msg.include?('--read-only') || msg.include?('--super-read-only')
Copy link
Owner

Choose a reason for hiding this comment

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

imho: I think this is better, but how about it?

!msg.nil? && ['--read-only', '--super-read-only'].any? { |term| msg.include?(term) }

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