[Backgroundrb-devel] Intermittent "can't convert Float into Hash" and results.rb

Mason Hale masonhale at gmail.com
Wed Jan 10 16:22:17 EST 2007


Thanks skaar. I'll add a ticket.

FYI -- I'm running my tests on a Macbook, OS X 10.4 w/ Ruby 1.8.4

On 1/10/07, skaar <skaar at waste.org> wrote:
>
> I do have a test case that is close to this, which at this point has
> shown the exception once on a 10K result assignment with 4 workers.
>
> (Mason - could you a ticket for this?)
>
> * Mason Hale (masonhale at gmail.com) [070110 13:27]:
> >    I've done some more work on this and have created a test case that
> >    reliably throws errors, although the errors themselves are not
> consistent.
> >    About 1 out of every 4 times, I get the "can't convert Symbol to
> Hash"
> >    error in server/lib/backgroundrb/results.rb:40 in 'merge!'.
> >
> >        keys.each_with_index do |k, i|
> >          assert_not_nil MiddleMan[k], "checking job_key #{k} on
> iteration
> >    #{i}"
> >          assert_not_nil MiddleMan[k].object, "checking object on
> iteration
> >    #{i}"
> >          assert_not_nil MiddleMan[k].object.results, "checking results
> on
> >    iteration #{i}"
> >          assert_equal(limit - 1,
> >    MiddleMan[k].object.results.to_hash[:counter], "checking counter on
> >    iteration #{i}")
> >        end
> >
> >      end
> >    end
>
> you should probably use MiddleMan.worker(k) here, which will benefit
> from the WorkerProxy (this is an inconsistency that I had overlooked)
> where you are re-directed directly to the results worker after the
> worker itself has gone away. so:
>
>   MiddleMan.worker(k).results
>
> also
>
>   MiddleMan.worker(k).results[:counter]
>
> should work as well.
>
> Another thing that worries me a little bit is that I see very different
> completion time. Everything from 10 minutes to almost 1/2 hour - that is
> with 4 x 10k results.
>
> /skaar
>
>
> --
> ----------------------------------------------------------------------
> |\|\             where in the       |          s_u_b_s_t_r_u_c_t_i_o_n
> | | >===========  W.A.S.T.E.        |                  genarratologies
> |/|/    (_)     is the wisdom       |                  skaar at waste.org
> ----------------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070110/426bdb60/attachment-0001.html 


More information about the Backgroundrb-devel mailing list