Yeah, that is how you would configure all errors for a class. And yes, you
would need to scope the errors to the class/message and wouldn't be able to
use configs for ancestors (I'm not sure if we'd want to do this).

I do see the value in a generic proc, this just seems scoped enough that I
don't think it'd be an issue. I'm going to merge this as is for now, and we
can always revisit.


On Tue, May 27, 2014 at 12:01 PM, Aaron Suggs <notifications@github.com>wrote:

> In lib/slave_pools/engine.rb:
>
> > @@ -21,6 +21,9 @@ class Engine < Rails::Engine
> >          else
> >            warn "Unsupported ActiveRecord version #{ActiveRecord.version}. Please whitelist the safe methods."
> >          end
> > +      SlavePools.config.no_replay_on_master = {
> > +        Mysql2::Error => ['Timeout waiting for a response from the last query']
>
> @dandrabik <https://github.com/dandrabik> IMHO, the safe_to_replay method
> *is* configuration, so it's ok to recreate it in config. NBD either way.
>
> So just to make sure I understand this YAML format, to skip replays for
> all errors of a particular class, you put an empty string as the message
> value:
>
> TimeoutError:
>   - ''
>
> And since we're using class.to_s, we can't use an ancestor class/module.
> Could be a gotcha down the road.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kickstarter/slave_pools/pull/9/files#r13085614>
> .
>