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

All connections blacklisted, even after coming back online #36

Closed
jdowning opened this issue Jan 30, 2014 · 3 comments
Closed

All connections blacklisted, even after coming back online #36

jdowning opened this issue Jan 30, 2014 · 3 comments

Comments

@jdowning
Copy link

Similar to #32

Environment:

  • Rails 4.0.2
  • Ruby 2.0.0
  • PostgreSQL 9.2
  • Makara 1dea246

Use case:

  1. Start application with master and slave db online
  2. GET generates 200
  3. Stop slave db
  4. GET generates 200
  5. Start slave db and stop master db
  6. GET generates 500

The makara adapter doesn't appear to put the slave back into the pool when it comes back online and believes all connections are blacklisted:

ActionView::Template::Error ([Makara] All connections are blacklisted - [Makara] Blacklisted connection: master-db1 -> PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly

ActionView::Template::Error (undefined method `_makara_blacklisted?' for nil:NilClass):
@mnelson
Copy link
Contributor

mnelson commented Jan 30, 2014

This may be fixed in master now that safe_value() does not assume a connection is present.

@jdowning
Copy link
Author

This looks to be fixed in 72d3cc7. The only caveat is since the slaves are always trying to perform SELECTs. When the slave is taken down, there is always one failure (HTTP 500) before makara successfully switches to using the master db. (Refs #35)

@mnelson
Copy link
Contributor

mnelson commented Jan 31, 2014

Closing. Merging of #35 will happen. Just trying to figure out these last few edge cases

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

No branches or pull requests

2 participants