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

skaar skaar at waste.org
Wed Jan 10 16:05:01 EST 2007


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
----------------------------------------------------------------------


More information about the Backgroundrb-devel mailing list