Basically, I got burnt by EventMachine which claimed JRuby compatibility but the java implementation failed on thread safety issues in standard patterns (Thread.new{EM.run}
doesn't work under JRuby for example) - we're talking pretty basic EM functions here.
Unfortunately, most JRuby gems are MRI gems previously not really used in proper multithreaded environments (occasional Thread.new in passenger doesn't count), kinda coded to be reasonably thread-safe and "tweaked until tests are green" in JRuby. Considering how hard it is to catch and test for thread-safety issues it's reasonable to assume that many of these gems will break under load.
Sure, benchmarking will identify many of these issues, but benchmarking is often very hard to do for more complex workflows (such as "logged in user transaction processing with third parties") and will almost certainly leak funny and hard to catch bugs into production given enough complexity of the application.
So the questions are, if you have experience with running a relatively complex high-throughput multithreaded rails app,
- how do you choose your gems? (is there a resource listing battle-tested gems etc)
- how do you test for thread-safety before deployment and how often do issues leak into production after testing?
- how often, on average, do you encounter thread-safety issues in gems that claim thread-safety and/or jruby compliance?
- how often do gem updates burn you?