AO3-4575 Add activerecord-mysql-reconnect gem #2465

Merged
merged 3 commits into from Jun 30, 2016

3 participants

@zz9pzza zz9pzza Add activerecord-mysql-reconnect gem
fd80028
@shalott
Organization for Transformative Works member

Whoops, actually, doesn't this need a configuration? Per https://github.com/winebarrel/activerecord-mysql-reconnect?

@houndci-bot houndci-bot commented on the diff Jun 19, 2016
config/environments/test.rb
@@ -34,4 +34,12 @@
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ # https://github.com/winebarrel/activerecord-mysql-reconnect
+ config.active_record.enable_retry = true
+ config.active_record.execution_tries = 20 # times
+ config.active_record.execution_retry_wait = 0.3 # sec
+ # :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
+ config.active_record.retry_mode = :rw
+

Extra empty line detected at block body end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@houndci-bot houndci-bot commented on the diff Jun 19, 2016
config/environments/staging.rb
@@ -73,4 +73,12 @@
Bullet.counter_cache_enable = false
end
+ # https://github.com/winebarrel/activerecord-mysql-reconnect
+ config.active_record.enable_retry = true
+ config.active_record.execution_tries = 20 # times
+ config.active_record.execution_retry_wait = 0.3 # sec
+ # :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
+ config.active_record.retry_mode = :rw
+
+

Extra blank line detected.
Extra empty line detected at block body end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@houndci-bot houndci-bot commented on the diff Jun 19, 2016
config/environments/production.rb
@@ -59,4 +59,12 @@
# :exception_recipients => ArchiveConfig.ERROR_ADDRESS
# end
+ # https://github.com/winebarrel/activerecord-mysql-reconnect
+ config.active_record.enable_retry = true
+ config.active_record.execution_tries = 20 # times
+ config.active_record.execution_retry_wait = 0.3 # sec
+ # :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
+ config.active_record.retry_mode = :rw
+
+

Extra blank line detected.
Extra empty line detected at block body end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@zz9pzza zz9pzza Make config explicit
a83ba72
@shalott
Organization for Transformative Works member

Do we really want 20 retries over 6 seconds? Wouldn't it be safer to do, say, 3 retries and then give up? I'm happy to be convinced otherwise, just want to know what the reason is for this configuration, since there's no commenting or info in the issue.

@zz9pzza

Its more of an intuition, and each try will be quick ?

@shalott
Organization for Transformative Works member

OK!

@sarken sarken merged commit 9f0a77f into otwcode:master Jun 30, 2016

2 checks passed

Details continuous-integration/travis-ci/pr The Travis CI build passed
hound 5 violations found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment