From: aaron@... Date: 2015-01-21T07:41:20+00:00 Subject: [ruby-core:67716] [Backport200 - Backport #9132] Mutex error while using EM.defer with Ruby 2.0.0 Issue #9132 has been updated by Aaron Stone. The error also shows up here: https://github.com/iconara/cql-rb/issues/68 ---------------------------------------- Backport #9132: Mutex error while using EM.defer with Ruby 2.0.0 https://bugs.ruby-lang.org/issues/9132#change-51146 * Author: Alexander Babichev * Status: Open * Priority: Normal * Assignee: ---------------------------------------- We are in process of migrating our gem from ruby-1.9.3 to ruby-2.0.0. While running rspec examples with v2.0.0 sometimes the following error happens: /usr/local/lib/ruby/2.0.0/thread.rb:188:in `synchronize': Attempt to unlock a mutex which is locked #by another thread (ThreadError) from /usr/local/lib/ruby/2.0.0/thread.rb:188:in `block in pop' from /usr/local/lib/ruby/2.0.0/thread.rb:187:in `handle_interrupt' from /usr/local/lib/ruby/2.0.0/thread.rb:187:in `pop' from /usr/local/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:1036:in #`block in spawn_threadpool' Initially, I thought that might be related to this EnventMachine issue: https://github.com/eventmachine/eventmachine/issues/457. But more detailed analysis shows that it might be ruby-2.0.0: - mutex error never been observed with ruby-1.9.3-p448, ruby 2.1.0dev(2013-11-20 trunk 43737), and rbx-2.1.1 - error happens with ruby-2.0.0-p247, and stable snapshot ruby 2.0.0p350 (2013-11-20 revision 43733) How to reproduce it: see gist https://gist.github.com/shurab/7472793 Environment: ruby-2.0.0-427, eventmachine (1.0.3), rspec (2.14.1) -- https://bugs.ruby-lang.org/