We ran into some problems accessing a freshly created worker, and had to insert a sleep of 1 second to get it to work. It looks like Ezra and skaar already know this: from middleman.rb: # HACK: there is a race in the worker/slave creation, we # currently need to sleep between create. sleep 0.1 You might want to increase it to 1 second for those of us on slowly mac books. Thanks for all your hard work on backgroundrb, it''s a beautiful piece of work! Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061107/3ba60fee/attachment.html
Hi, I''m seeing "Starting WorkerLogger" in the log, but no ResultsLogger. Subsequently, when I assign to the results hash in my worker it disappears into neverland. Could this be the problem I''m experiencing? thanks, James On 11/7/06, Jason Sydes <jasonsydes at gmail.com> wrote:> We ran into some problems accessing a freshly created worker, and had to > insert a sleep of 1 second to get it to work. It looks like Ezra and skaar > already know this: > > from middleman.rb: > # HACK: there is a race in the worker/slave creation, we > # currently need to sleep between create. > sleep 0.1 > > You might want to increase it to 1 second for those of us on slowly mac > books. > > Thanks for all your hard work on backgroundrb, it''s a beautiful piece of > work! > > Jason > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > >
On 11/15/06, James Hughes <hughes.james at gmail.com> wrote:> I''m seeing "Starting WorkerLogger" in the log, but no ResultsLogger. > Subsequently, when I assign to the results hash in my worker it > disappears into neverland. Could this be the problem I''m experiencing? >Maaaybe. The Results and Logger workers get started when you start backgroundrb w/ "script/backgroundrb start", long before you create a new worker (or even start rails). Then again, the Results and Logger workers are mostly just regular workers that get initialized the same way as other workers, so they may be getting ''lost'' in the same way? Not sure! You may want to try the ''end.join'' fix that skaar just checked in ( http://backgroundrb.devjavu.com/projects/backgroundrb/changeset/154), which I believe should fix at least the problem I originally described: In vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb, just change the closing ''end'' of the ''@thread_pool.dispatch do'' block to '' end.join''. You''re not seeing "In ResultsWorker" in backgroundrb.log. Are you using release-0.2.0, or are you working from the trunk? What do you see when you do ps aux |grep backgroundrb ? Maybe you''re assigning to the results hash incorrectly? If you''re doing something like the following, it won''t work (see the README): results[:other_key] = [] results[:other_key] << "add to key" Jason On 11/7/06, Jason Sydes <jasonsydes at gmail.com> wrote:> > We ran into some problems accessing a freshly created worker, and had to > > insert a sleep of 1 second to get it to work. It looks like Ezra and > skaar > > already know this: > > > > from middleman.rb: > > # HACK: there is a race in the worker/slave creation, we > > # currently need to sleep between create. > > sleep 0.1 > > > > You might want to increase it to 1 second for those of us on slowly mac > > books. > > > > Thanks for all your hard work on backgroundrb, it''s a beautiful piece of > > work! > > > > Jason > > > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061115/6ae9a85a/attachment.html
On 11/15/06, Jason Sydes <jasonsydes at gmail.com> wrote:> On 11/15/06, James Hughes <hughes.james at gmail.com> wrote: > > > I''m seeing "Starting WorkerLogger" in the log, but no ResultsLogger. > > Subsequently, when I assign to the results hash in my worker it > > disappears into neverland. Could this be the problem I''m experiencing? > > > You''re not seeing "In ResultsWorker" in backgroundrb.log. Are you using > release-0.2.0, or are you working from the trunk? What do you see when you > do > ps aux |grep backgroundrb > ?I''m on 0.2.0 but I was thinking of switching to trunk. I am seeing the results worker in ps. Wierd that the logger would announce it''s presence and not the results worker.> > Maybe you''re assigning to the results hash incorrectly? If you''re doing > something like the following, it won''t work (see the README): > results[:other_key] = [] > results[:other_key] << "add to key" >Yeh, it''s when I assign to it that it disappears. I''ll look into this a bit more. thanks, James