[Mongrel] Software caused connection abort

Jan Svitok jan.svitok at gmail.com
Thu Aug 10 12:24:37 EDT 2006


On 8/10/06, Philip Lipu Tsai <tsailipu at gmail.com> wrote:
>  Hi Zed or anyone that is also looking at Mongrel,
>
>  Just want to report something that, although doesn't crash mongrel, is
> rather annoying.
>
>  I am running the latest Mongrel 0.3.13.3 - ruby version on cygwin
> (yeah, poor me).  When I start mongrel_rails with
> ActiveRecord::Base.allow_concurrency = true in environment.rb, I see a
> lot of
>   "Error sending file /cygdrive/c/[snipped]/[default java scripts].js
> : Software caused connection abort"
>
>  While these don't cause any harm, they are concerning...
>  Also, I see the following error more often as well:
>
> Lost connection to MySQL server during query
>  [ the exception traces vary but do involve routing; here is an example:]
> /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/vendor/mysql.rb:1112:in
> `write'
> /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/vendor/mysql.rb:1162:in
> `finalizer'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/code_generation.rb:54:in
> `<<'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/routing.rb:548:in
> `generation_code_for'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/code_generation.rb:46:in
> `method_missing'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/code_generation.rb:19:in
> `indent'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/code_generation.rb:46:in
> `method_missing'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/routing.rb:545:in
> `generation_code_for'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/routing.rb:488:in
> `write_generation'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/routing.rb:482:in
> `write_generation'
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/routing.rb:629:in
> `draw'
> #{RAILS_ROOT}/config/routes.rb:1
> /usr/bin/mongrel_rails:18
>
>  When I see such page, refreshing once or twice typically works.
>
>  With  ActiveRecord::Base.allow_concurrency set to false (i.e. the
> default), everything chugs along pretty well.   Don't know whether
> this problem is particular to cygwin environment or is generic when
> one turns on ActiveRecord::Base.allow_concurrency (or this is just my
> system...).

mail by Zed from another thread (mongrel and multi apps):

> Someone else can speak to Rails and whether it actually is threadsafe or not.
>
> However, you misunderstand Mongrel's handler for Rails.  Take a look
> at the source code.  It's clean and easy to read.  The Rails handler
> has a single Rails application instance, and it has a mutex that it
> uses to limit request processing within Rails to one at a time.  The
> use of this guard mutex can be disabled in the handler, if you want to
> use Rails multithreaded, but Zed has a strongly worded warning against
> doing that in the code.
>

Yes, also known as the Great Katana Suicide Warning.

The name should probably tell that you shouldn't use it.


More information about the Mongrel-users mailing list