That works. Thank you! On Friday, November 11, 2016 at 8:51:43 PM UTC-5, Jeremy Evans wrote: > > On Friday, November 11, 2016 at 5:46:03 PM UTC-8, [email protected] > <javascript:> wrote: >> >> Is there a good way to handle AWS Aurora failovers without having to >> restart the process using Sequel? I've configured Sequel to point at the >> writer endpoint but I start seeing `Mysql2::Error: The MySQL server is >> running with the --read-only option so it cannot execute this statement` >> errors when failovers happen because the master is first downgraded to a >> slave as part of the process. Unfortunately it doesn't look like this sort >> of error causes the connection to get torn down and replaced so we get >> errors on every write until the process using Sequel is restarted. >> >> Does anyone have any ideas on how best to approach this? >> > > You would have to start treating that exception as a disconnect error, > even though it's not technically a disconnect error: > > def DB.disconnect_error?(e, opts) > super || (e.is_a?(::Mysql2::Error) && e.message =~ /\AThe MySQL server > is running with the --read-only option so it cannot execute this statement/) > end > > Thanks, > Jeremy >
-- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
