On Mon, Apr 18, 2011 at 12:23:18AM -0700, Tom wrote: > > I hope you can help us out here... we've been using ruote for a while > now and recently switched to the redis backend (thanks for both libs > BTW, well done!). Shortly after we made the switch, we started getting > exceptions: > > undefined method `+' for nil:NilClass > ruote (2.2.0) lib/ruote/id/wfid_generator.rb:50:in `get_raw' > ruote (2.2.0) lib/ruote/id/wfid_generator.rb:70:in `get_raw' > ruote (2.2.0) lib/ruote/id/mnemo_wfid_generator.rb:35:in `generate' > ruote (2.2.0) lib/ruote/receiver/base.rb:68:in `launch' > > (...) > > The weird thing is, that this only seems to happen, if we call the > launch method (and therefore the ID generator) often within a short > interval - for example, in this case, we're trying to launch ~15 items > at the same time...
Hello Tom, welcome to ruote's mailing-list. Could I have more details ? I have tried (https://gist.github.com/927225) ---8<--- $:.unshift('lib') $:.unshift('../ruote-redis/lib') require 'rubygems' require 'yajl' require 'redis' require 'ruote' require 'ruote-redis' engine = Ruote::Engine.new( Ruote::Worker.new( Ruote::Redis::Storage.new( ::Redis.new(:db => 14, :thread_safe => true)))) engine.noisy = true pdef = Ruote.process_definition do john end engine.register do catchall end n = 30 wfids = [] n.times do Thread.new do wfids << engine.launch(pdef) wfids << engine.launch(pdef) wfids << engine.launch(pdef) end end sleep 10 p wfids.uniq.size --->8--- and (https://gist.github.com/927228) ---8<--- $:.unshift('lib') $:.unshift('../ruote-redis/lib') require 'rubygems' require 'yajl' require 'redis' require 'ruote' require 'ruote-redis' 2.times do Process.fork do engine = Ruote::Engine.new( Ruote::Redis::Storage.new( ::Redis.new(:db => 14, :thread_safe => true))) engine.noisy = true pdef = Ruote.process_definition do end p engine.launch(pdef) end end sleep 1 --->8--- with Ruby 1.8.7-p249 (and ruote + ruote-redis master) without issues. Do those work for you (with the vanila 2.2.0 gems) ? Which of those is closer to your use case ? Best regards, -- John Mettraux - http://jmettraux.wordpress.com -- you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en
