aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorPatrick Mahoney <pat@polycrystal.org>2012-05-25 13:19:19 -0500
committerPatrick Mahoney <pat@polycrystal.org>2012-05-25 13:19:19 -0500
commit02b233556377e9c40f17e2142d60cd82976ca9ea (patch)
tree2566e81a190f9bac2f1de2a7fce1fd1ace826d85 /actionpack/test
parent40cfcacca4c12a74556bfda3bded979df43434eb (diff)
downloadrails-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 'actionpack/test')
0 files changed, 0 insertions, 0 deletions