You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using fork method for spawn. I have a daemon which spawns jobs on request, but I wanted to limit concurrency, so created 3 worker threads to do the spawning within. I then ran into this race condition, and extracted the failure into the simplified code below. Any ideas? I was unable to figure out what is going wrong. Its probably something weird in my environment as I can't duplicate it in a fresh rails app
foo.rb:
class SpawnInit
include Spawn
def initialize
sid = spawn do
puts "Spawn initialized"
end
wait([sid])
end
end
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:285:in stop': stopping only thread (ThreadError) note: use sleep to stop forever from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:285:inmon_acquire'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:214:in mon_enter' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:240:insynchronize'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:496:in write' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:326:inadd'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:374:in info' from /Users/mconway/Documents/eclipse/workspace/sml/vendor/plugins/spawn/lib/spawn.rb:118:infork_it'
from /Users/mconway/Documents/eclipse/workspace/sml/vendor/plugins/spawn/lib/spawn.rb:90:in fork' ... 9 levels... from /Users/mconway/Documents/eclipse/workspace/sml/vendor/rails/railties/lib/commands/runner.rb:45 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from ./script/runner:3
Spawn initialized
The text was updated successfully, but these errors were encountered:
Closing to clean up as this in an old issue, if this is still valid on the latest version of spawnling then please re-open the issue and I will address it.
Using fork method for spawn. I have a daemon which spawns jobs on request, but I wanted to limit concurrency, so created 3 worker threads to do the spawning within. I then ran into this race condition, and extracted the failure into the simplified code below. Any ideas? I was unable to figure out what is going wrong. Its probably something weird in my environment as I can't duplicate it in a fresh rails app
foo.rb:
class SpawnInit
include Spawn
def initialize
sid = spawn do
puts "Spawn initialized"
end
wait([sid])
end
end
within RAILS_ROOT
./script/runner foo.rb
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:285:in
stop': stopping only thread (ThreadError) note: use sleep to stop forever from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:285:in
mon_acquire'from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:214:in
mon_enter' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:240:in
synchronize'from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:496:in
write' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:326:in
add'from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:374:in
info' from /Users/mconway/Documents/eclipse/workspace/sml/vendor/plugins/spawn/lib/spawn.rb:118:in
fork_it'from /Users/mconway/Documents/eclipse/workspace/sml/vendor/plugins/spawn/lib/spawn.rb:90:in
fork' ... 9 levels... from /Users/mconway/Documents/eclipse/workspace/sml/vendor/rails/railties/lib/commands/runner.rb:45 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from ./script/runner:3
Spawn initialized
The text was updated successfully, but these errors were encountered: