igrigorik/async-rails — Issue #19: `resume': fiber called across threads (FiberError) 
Author: modsaid
Created: 2011-11-29 01:51:45+00:00
State: open

Greetinsg igrigorik

I had my 3.0.3 rails application use the async package em_mysql2, em-http-request, ... nearly all the setup in here.

my thins die with the following Fiber error. it is apparently thread handling on the em_mysql2 side..

I need your insights about the problem. below you'll find my list of used gems

>> Writing PID to tmp/pids/thin.0.pid
>> Changing process privilege to webistrano:webistrano
>> Using rack adapter
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on /tmp/elections.0.socket, CTRL+C to stop
>> Exiting!
/usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.2.13/lib/active_record/connection_adapters/em_mysql2_adapter.rb:53:in `resume': fiber called across threads (FiberError)
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.2.13/lib/active_record/connection_adapters/em_mysql2_adapter.rb:53:in `block in query'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:158:in `call'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:158:in `set_deferred_status'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:198:in `fail'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.2.13/lib/active_record/connection_adapters/em_mysql2_adapter.rb:38:in `rescue in notify_readable'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.2.13/lib/active_record/connection_adapters/em_mysql2_adapter.rb:33:in `notify_readable'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
from /usr/local/akhbarak/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.3.1/bin/thin:6:in `'
from /usr/local/bin/thin:19:in `load'
from /usr/local/bin/thin:19:in `

'

bundle list
Gems included by the bundle:
* abstract (1.0.0)
* actionmailer (3.0.3)
* actionpack (3.0.3)
* activemodel (3.0.3)
* activerecord (3.0.3)
* activeresource (3.0.3)
* activesupport (3.0.3)
* addressable (2.2.6)
* arel (2.0.10)
* authlogic (2.1.6)
* aws-s3 (0.6.2)
* builder (2.1.2)
* bundler (1.0.21)
* cocaine (0.2.0)
* daemons (1.1.4)
* em-http-request (1.0.0)
* em-socksify (0.1.0)
* em-synchrony (1.0.0)
* erubis (2.6.6)
* eventmachine (1.0.0.beta.4)
* factory_girl (2.2.0)
* factory_girl_rails (1.3.0)
* http_parser.rb (0.5.3)
* i18n (0.6.0)
* json (1.5.3)
* mail (2.2.19)
* mime-types (1.17.2)
* mysql2 (0.2.13)
* newrelic_rpm (3.3.0)
* paperclip (2.3.16)
* polyglot (0.3.3)
* rack (1.2.4)
* rack-fiber_pool (0.9.2)
* rack-mount (0.6.14)
* rack-test (0.5.7)
* rails (3.0.3)
* rails3-generators (0.17.4)
* railties (3.0.3)
* rake (0.8.7)
* shoulda (2.11.3)
* thin (1.3.1)
* thor (0.14.6)
* treetop (1.4.10)
* tzinfo (0.3.30)
* will_paginate (3.0.0)
* xml-simple (1.1.1)