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

Fix: an application freezes when a slave is down #180

Merged
merged 1 commit into from
Nov 14, 2017

Conversation

palexvs
Copy link
Contributor

@palexvs palexvs commented Nov 12, 2017

I get a freeze application (Rails 5.1.4, ActiveRecord 5.1.4) when slave is down with infinitive count of requests like:

SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci,  @@SESSION.sql_mode = 'TRADITIONAL',  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483

config:

  makara:
    sticky: false
    master_strategy: failover
    slave_strategy: failover

    connections:
      - role: master
        host: <%= SENV['MYSQL_HOST_MASTER'] %>
        disable_blacklist: true
      - role: slave
        host: <%= SENV['MYSQL_HOST_SLAVE'] %>
        blacklist_duration: 60
      - role: slave
        host: <%= SENV['MYSQL_HOST_MASTER'] %>
        disable_blacklist: true

It happens when line con.send(method, *args) raises an error Can't connect to MySQL server but nothing handles it

@bleonard
Copy link
Contributor

Thanks!

@bleonard bleonard merged commit 52bdfed into instacart:master Nov 14, 2017
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