Following up on this item, I found that if I remove any calls to add values to the results_worker hash, the errors described below go away.<br><br>I also found that in some cases the call to 'BackgrouDRb::Results::stored' was returning the symbol :backgroundrb_results instead of a hash, thus triggering the "can't convert Symbol to Hash" TypeError.
<br><br>I made a pass at synchronizing the WorkerResults []= and [] methods via Mutex, but was unsuccessful. I suspect it may have something to do with Mutex not being reentrant. <br><br>See:<br><a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/24470">
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/24470</a><br><a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/172652">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/172652</a><br>
<br>In any case, avoiding use of results avoids the issue. For the time being, I'm storing any process state information in a database instead.<br><br>Mason<br><br><div><span class="gmail_quote">On 1/10/07, <b class="gmail_sendername">
skaar</b> <<a href="mailto:skaar@waste.org">skaar@waste.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It might be that we have to introduce a mutex in the results worker
<br>where this happens. I'll try to get this reproduced sometime this<br>weekend.<br><br>/skaar<br><br><br>* Mason Hale (<a href="mailto:masonhale@gmail.com">masonhale@gmail.com</a>) [070109 14:42]:<br>> I'm getting a similar error, here a partial stack trace:
<br>><br>> 20070108-20:17:45 (27597) can't convert Symbol into Hash - (TypeError)<br>> 20070108-20:17:45 (27597)<br>> /opt/lss/demo/0.4-06/vendor/plugins/backgroundrb/server/lib/backgroundrb/results.rb:40:in
<br>> `merge!'<br>> 20070108-20:17:45 (27597)<br>> /opt/lss/demo/0.4-06/vendor/plugins/backgroundrb/server/lib/backgroundrb/results.rb:40:in<br>> `[]='<br>><br>> The process will run fine for hours or days, but then will stop with this
<br>> error. When it happens it takes now the entire BackgrounDRb server. (I'm<br>> addding some begin/rescue blocks to hopefully prevent that.)<br>><br>> I've got Ruby 1.8.5p12 compiled with gcc
3.4.6 on RedHat Linux.<br>><br>> This also seems to occur with more than one process (running the same<br>> worker class) at the same tim<br>><br>> Any ideas?<br>><br>> Mason<br>><br>> On 1/7/07, Robert Bjarnason <[1]robert.bjarnason@
<a href="http://gmail.com">gmail.com</a>> wrote:<br>><br>> Hi Bob,<br>><br>> Thanks for the pointer, I agree this is probably not a directly<br>> backgroundrb related problem. I built Ruby
1.8.4 on a Debian Linux box<br>> using gcc version 3.3.5.<br>><br>> Warm regards,<br>> Robert Bjarnason<br>><br>> Bob Hutchison wrote:<br>> > Hi,<br>> ><br>> > This sounds a bit like the trouble in OS X where you'd get a Fixednum
<br>> > to String error. This was caused by a bug in the gcc 4.0 compiler. The<br>> > solution on OS X is to re-compile Ruby with -O1 optimisation level or<br>> > switch to the gcc 3.x compiler). As I understand it, with linux you
<br>> > have the additional option of installing a newer version of gcc 4.x<br>> > and recompiling (I'm using 4.0.2 on one of my linux boxes and have<br>> > never seen the problem).<br>
> ><br>> > Cheers,<br>> > Bob<br>> ><br>> > On 4-Jan-07, at 11:44 AM, Robert Bjarnason wrote:<br>> ><br>> >> Hi,<br>> >><br>> >> I'm using backgroundrb
0.2.1 in a production environment and for most<br>> >> parts I'm very happy. We are using it to do some heavy video editing<br>> on<br>> >> the server side and it works great except that under, what seems
<br>> heavy<br>> >> load the below problem happens intermittently.<br>> >><br>> >> The problem has only happened 5 times out of over 500 runs by our<br>> >> backgroundrb worker.
<br>> >><br>> >> This is the code in our worker:<br>> >> logger.debug("info : progress: #{progress}")<br>> >> progress_percent = progress * 100
<br>> >> if progress_percent >= 100<br>> >> results[:progress] = 99.99<br>> >> else<br>> >> results[:progress] = progress_percent <-- Line of the
<br>> >> crash<br>> >> end<br>> >><br>> >> Here is the error:<br>> >> can't convert Float into Hash<br>> >><br>> >> And the beginning of the stack trace:
<br>> >><br>> /.../ContentStore/vendor/plugins/backgroundrb/server/lib/backgroundrb/results.rb:40<br>> >><br>> >> :in<br>> >><br>> `merge!'/.../ContentStore/vendor/plugins/backgroundrb/server/lib/backgroundrb/results.rb:40
<br>> >><br>> >> :in `[]='/.../ContentStore/lib/workers/content_worker.rb:40<br>> >> :in<br>> `execute_mp4box'/.../ContentStore/lib/workers/content_worker.rb:22:<br>
> >> in `execute_mp4box'/.../ContentStore/lib/workers/content_worker.rb:21<br>> >> :in<br>> `execute_mp4box'/.../ContentStore/lib/workers/content_worker.rb:181<br>> >> :in
<br>> >><br>> `do_work'/.../ContentStore/vendor/plugins/backgroundrb/server/lib/backgroundrb/worker.rb:55:<br>> >><br>> >> ...<br>> >><br>> >> The problem seems to happen only under heavy load where more than 1
<br>> >> worker process is active at the same time.<br>> >><br>> >> Any ideas or leads?<br>> >><br>> >> Thanks,<br>> >> Robert Bjarnason<br>
> >><br>> >> _______________________________________________<br>> >> Backgroundrb-devel mailing list<br>> >> [2]Backgroundrb-<a href="mailto:devel@rubyforge.org">devel@rubyforge.org
</a><br>> >> [3]http://rubyforge.org/mailman/listinfo/backgroundrb-devel<br>> ><br>> > ----<br>> > Bob Hutchison -- blogs at<br>> > <[4]http://www.recursive.ca/hutch/>
<br>> > Recursive Design Inc. -- <[5]http://www.recursive.ca/><br>> > Raconteur -- <[6]http://www.raconteur.info/ ><br>> > xampl for Ruby --
<br>> <[7]http://rubyforge.org/projects/xampl/><br>> ><br>> ><br>> ><br>> ><br>><br>> _______________________________________________<br>> Backgroundrb-devel mailing list
<br>> [8]Backgroundrb-<a href="mailto:devel@rubyforge.org">devel@rubyforge.org</a><br>> [9]http://rubyforge.org/mailman/listinfo/backgroundrb-devel<br>><br>> References<br>><br>> Visible links
<br>> 1. mailto:<a href="mailto:robert.bjarnason@gmail.com">robert.bjarnason@gmail.com</a><br>> 2. mailto:<a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>> 3. <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">
http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br>> 4. <a href="http://www.recursive.ca/hutch/">http://www.recursive.ca/hutch/</a><br>> 5. <a href="http://www.recursive.ca/">http://www.recursive.ca/
</a><br>> 6. <a href="http://www.raconteur.info/">http://www.raconteur.info/</a><br>> 7. <a href="http://rubyforge.org/projects/xampl/">http://rubyforge.org/projects/xampl/</a><br>> 8. mailto:<a href="mailto:Backgroundrb-devel@rubyforge.org">
Backgroundrb-devel@rubyforge.org</a><br>> 9. <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br><br>> _______________________________________________
<br>> Backgroundrb-devel mailing list<br>> <a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>> <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">http://rubyforge.org/mailman/listinfo/backgroundrb-devel
</a><br><br>--<br>----------------------------------------------------------------------<br>|\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n<br>| | >=========== W.A.S.T.E. | genarratologies
<br>|/|/ (_) is the wisdom | <a href="mailto:skaar@waste.org">skaar@waste.org</a><br>----------------------------------------------------------------------<br></blockquote></div><br>