1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Jonathan Rochkind
cb6f839359 ConnectionPool wait_timeout no longer used for different types of timeouts. #6441
An AR ConnectionSpec `wait_timeout` is pre-patch used for three
different things:

* mysql2 uses it for MySQL's own wait_timeout (how long MySQL
  should allow an idle connection before closing it), and
  defaults to 2592000 seconds.
* ConnectionPool uses it for "number of seconds to block and
  wait for a connection before giving up and raising a timeout error",
  default 5 seconds.
* ConnectionPool uses it for the Reaper, for deciding if a 'dead'
  connection can be reaped. Default 5 seconds.

Previously, if you want to change these from defaults, you need
to change them all together. This is problematic _especially_
for the mysql2/ConnectionPool conflict, you will generally _not_
want them to be the same, as evidenced by their wildly different
defaults. This has caused real problems for people #6441 #2894

But as long as we're changing this, forcing renaming the
ConnectionPool key to be more specific, it made sense
to seperate the two ConnectionPool uses too -- these two
types of ConnectionPool timeouts ought to be able to be
changed independently, you won't neccesarily want them
to be the same, even though the defaults are (currently)
the same.
2012-05-23 12:08:11 -04:00
Aaron Patterson
59f2696d00 rename start to run and use Thread.pass rather than sleeping to schedule the watchdog 2011-12-30 16:10:53 -08:00
Aaron Patterson
405aeb5da4 connection pool starts the reaper 2011-12-30 15:39:39 -08:00
Aaron Patterson
3af68df080 just dup the spec now that it will deep copy 2011-12-30 15:36:48 -08:00
Aaron Patterson
41c24eb3e3 each connection pool has a reaper 2011-12-30 15:27:41 -08:00
Aaron Patterson
cde7692d4e introduce a timer class for reaping connections 2011-12-30 15:19:07 -08:00