Hi, All<br><br>Appreciate all the assistance, turns out this is a problem resulting from <br><br>Rails <= 2.1.1 and Postgres (to do with the way binary fields are escaped) <br><br>I upgraded Rails and it works.<br><br>Thanks<br>
Justin<br><br><div class="gmail_quote">On Sat, Mar 14, 2009 at 11:07 AM, Justin Wood <span dir="ltr"><<a href="mailto:justin.wood@trifectagis.com">justin.wood@trifectagis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, Hemant<br><br>Ah ok. Found out where it was making the call in in meta_worker and saw the args coming back nil from load_data. So I ran this in IRB<br><br>>> job=BdrbJobQueue.find(:first,:conditions => [" worker_name = ? AND taken = ? AND scheduled_at <= ? ", "notification_worker", 0, Time.now.utc ])<br>
=> #<BdrbJobQueue id: 53, args: "\\004\\010\"\\011asdf", worker_name: "notification_worker", worker_method: "asdf", job_key: "Fri Mar 13 16:14:48 +1300 2009", taken: 0, finished: 0, timeout: nil, priority: nil, submitted_at: "2009-03-13 03:14:48", started_at: nil, finished_at: nil, archived_at: nil, tag: nil, submitter_info: nil, runner_info: nil, worker_key: "", scheduled_at: "2009-03-13 03:14:51"><br>
>> job.args<br>=> "\\004\\010\"\\011asdf"<br>>> Marshal.load(job.args)<br>TypeError: incompatible marshal file format (can't be read)<br> format version 4.8 required; 92.48 given<br>
from (irb):10:in `load'<br> from (irb):10<br><br>So the problem is with marshalling ... double checked that by putting a logger statement into BdrbServerHelper's load_data like so:<br> <br>...<br>rescue<br>
error_msg = $!.message<br> logger.error("Error marshaling data: #{data} #{error_msg}) #added<br> if error_msg =~ /^undefined\ .+\ ([A-Z].+)/<br>....<br><div class="gmail_quote"><br>and got the same error message. Having something going to the log in the rescue there would be a useful addition.<br>
<br>I'm using Postgres 8.3.1 (database in utf8) on Ubuntu found someone else that encountered a marshalling error here:<br><br><a href="http://blade.nagaokaut.ac.jp/ruby/ruby-talk/116099" target="_blank">http://blade.nagaokaut.ac.jp/ruby/ruby-talk/116099</a><br>
<br>Looks like a ruby/Postgres issue? I'll have a look see if I can sort this out but any advice you could give me would be much appreciated.<br><br>Thanks<br><font color="#888888">Justin</font><div><div></div><div class="h5">
<br><br><br>On Fri, Mar 13, 2009 at 8:58 PM, hemant <span dir="ltr"><<a href="mailto:gethemant@gmail.com" target="_blank">gethemant@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Fri, Mar 13, 2009 at 11:57 AM, Justin Wood<br>
<<a href="mailto:justin.wood@trifectagis.com" target="_blank">justin.wood@trifectagis.com</a>> wrote:<br>
> Hi, Samer<br>
><br>
> Thanks for the quick reply. I changed things a bit and ran this<br>
><br>
>>><br>
>>> MiddleMan.new_worker(:worker=>:notification_worker,:worker_key=>'testkey',:data=>"data<br>
>>> arguement")<br>
> => "testkey"<br>
>>><br>
>>> MiddleMan.worker(:notification_worker,'testkey').enq_send_warranty_notice(:job_key=>Time.now.to_s,:arg<br>
>>> => "asdf",:scheduled_at => Time.now + 3.second)<br>
> => true<br>
><br>
> ... but the arg is still not being passed.<br>
><br>
> My understanding of new_worker is it explictly creates a worker for you that<br>
> you can refer to by the key, so<br>
><br>
> If I do this:<br>
><br>
> MiddleMan.worker(:notification_worker,'testkey')<br>
><br>
> I'm getting the worker I created above but when I call this:<br>
><br>
> MiddleMan.worker(:notification_worker)<br>
><br>
> I'm getting the default worker that was created at startup.<br>
><br>
> Regardless of how the worker is created the "arg" parameter is still not<br>
> being passed when it gets invoked to do enqued work. Going through the<br>
> code ... I can't figure out how it gets invoked.<br>
><br>
<br>
</div>Well whatever you pass to enq_xxx method gets marshalled to database<br>
and gets unmarshalled from table when the task is scheduled inside<br>
worker. Can you paste your worker code?<br>
</blockquote></div></div></div><br>
</blockquote></div><br>