diff options
author | Patrick Mahoney <pat@polycrystal.org> | 2012-05-25 13:19:19 -0500 |
---|---|---|
committer | Patrick Mahoney <pat@polycrystal.org> | 2012-05-25 13:19:19 -0500 |
commit | 02b233556377e9c40f17e2142d60cd82976ca9ea (patch) | |
tree | 2566e81a190f9bac2f1de2a7fce1fd1ace826d85 /activerecord/test/cases/validations_repair_helper.rb | |
parent | 40cfcacca4c12a74556bfda3bded979df43434eb (diff) | |
download | rails-02b233556377e9c40f17e2142d60cd82976ca9ea.tar.gz rails-02b233556377e9c40f17e2142d60cd82976ca9ea.tar.bz2 rails-02b233556377e9c40f17e2142d60cd82976ca9ea.zip |
Make connection pool fair with respect to waiting threads.
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.
Diffstat (limited to 'activerecord/test/cases/validations_repair_helper.rb')
0 files changed, 0 insertions, 0 deletions