Hi Matt, the issue is you're not running in thread-safe mode.
Your understanding is right - if you've used "plain" JRuby-Rack (e.g. with Warbler) it would have worked.
The JRuby-Rack default due backward compatibility is thread-safe for Rack and pooling for Rails applications.
With Trinidad we assume 1:5 pooling by default and there's no special handling to change that for Rack apps.
Thus it's behaving the same no-matter what type of application - I'm about to release a new version but I think I'll leave this as is.
Although we should mention pooling is default for all in the README (this will most likely change with Rails 4.0 adoption) ...
Rack pooling was not-supported previously (only Rails) with JRuby-Rack (<= 1.1.7) thus even if min:max runtimes were set to 1:5 it did not pool.
You can check with your logs what's happening - now they should contain a line :
using 1:5 runtime pool with acquire timeout of 5.0 secondsTry running with --threadsafe option or set jruby_min_runtimes == jruby+max_runtime == 1 in the config and you should instead see :
using a shared (threadsafe!) runtimeFor the record if someone gets here with the same error using pooling - you should increase your application pool size (jruby_max_runtimes).
Also it's desirable to boot as many runtimes as possible during startup thus we recommend set jruby_min_runtimes high (close to max) as well.
The runtime acquire timeout migth be decreased as well (JRuby-Rack's default timeout of 10 seconds seems still too much but was actually 30 previously).
K.