1. 09 7月, 2013 1 次提交
  2. 15 6月, 2013 1 次提交
  3. 14 3月, 2013 1 次提交
  4. 22 1月, 2013 1 次提交
  5. 20 1月, 2013 1 次提交
  6. 11 9月, 2012 1 次提交
    • J
      ConnectionPool, unify exceptions, ConnectionTimeoutError · 5b7cfc5e
      Jonathan Rochkind 提交于
      As a result of different commits, ConnectionPool had become
      of two minds about exceptions, sometimes using PoolFullError
      and sometimes using ConnectionTimeoutError. In fact, it was
      using ConnectionTimeoutError internally, but then recueing
      and re-raising as a PoolFullError.
      
      There's no reason for this bifurcation, standardize on
      ConnectionTimeoutError, which is the rails2 name and still
      accurately describes semantics at this point.
      
      History
      
      In Rails2, ConnectionPool raises a ConnectionTimeoutError if
      it can't get a connection within timeout.
      
      Originally in master/rails3, @tenderlove had planned on removing
      wait/blocking in connectionpool entirely, at that point he changed
      exception to PoolFullError.
      
      But then later wait/blocking came back, but exception remained
      PoolFullError.
      
      Then in 02b23355 pmahoney introduced fair waiting logic, and
      brought back ConnectionTimeoutError, introducing the weird bifurcation.
      
      ConnectionTimeoutError accurately describes semantics as of this
      point, and is backwards compat with rails2, there's no reason
      for PoolFullError to be introduced, and no reason for two
      different exception types to be used internally, no reason
      to rescue one and re-raise as another.  Unify!
      5b7cfc5e
  7. 12 6月, 2012 1 次提交
  8. 26 5月, 2012 1 次提交
    • P
      Make connection pool fair with respect to waiting threads. · 02b23355
      Patrick Mahoney 提交于
      The core of this fix is a threadsafe, fair Queue class.  It is
      very similar to Queue in stdlib except that it supports waiting
      with a timeout.
      
      The issue this solves is that if several threads are contending for
      database connections, an unfair queue makes is possible that a thread
      will timeout even while other threads successfully acquire and release
      connections.  A fair queue means the thread that has been waiting the
      longest will get the next available connection.
      
      This includes a few test fixes to avoid test ordering issues that
      cropped up during development of this patch.
      02b23355
  9. 24 5月, 2012 1 次提交
    • J
      ConnectionPool wait_timeout no longer used for different types of timeouts. #6441 · cb6f8393
      Jonathan Rochkind 提交于
      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.
      cb6f8393
  10. 23 5月, 2012 1 次提交
  11. 22 5月, 2012 1 次提交
  12. 21 5月, 2012 1 次提交
  13. 16 4月, 2012 1 次提交
  14. 13 3月, 2012 1 次提交
  15. 09 3月, 2012 2 次提交
  16. 04 1月, 2012 1 次提交
  17. 31 12月, 2011 6 次提交
  18. 30 11月, 2011 1 次提交
    • A
      Automatic closure of connections in threads is deprecated. For example · 0e2477b6
      Aaron Patterson 提交于
      the following code is deprecated:
      
      Thread.new { Post.find(1) }.join
      
      It should be changed to close the database connection at the end of
      the thread:
      
      Thread.new {
        Post.find(1)
        Post.connection.close
      }.join
      
      Only people who spawn threads in their application code need to worry
      about this change.
      0e2477b6
  19. 20 11月, 2011 1 次提交
  20. 09 8月, 2011 1 次提交
    • J
      Make it the responsibility of the connection to hold onto an ARel visitor for... · 7db90aa7
      Jon Leighton 提交于
      Make it the responsibility of the connection to hold onto an ARel visitor for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
      7db90aa7
  21. 07 6月, 2011 1 次提交
  22. 05 6月, 2011 1 次提交
    • J
      Refactor Active Record test connection setup. Please see the... · 253bb6b9
      Jon Leighton 提交于
      Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
      253bb6b9
  23. 29 3月, 2011 1 次提交
  24. 14 2月, 2011 1 次提交
  25. 09 2月, 2011 1 次提交
  26. 05 2月, 2011 3 次提交
  27. 01 12月, 2010 1 次提交
  28. 07 10月, 2010 1 次提交
  29. 17 7月, 2010 3 次提交
  30. 26 2月, 2009 1 次提交