[Backgroundrb-devel] Get "some read error" on calls to worker

hemant kumar gethemant at gmail.com
Mon Dec 17 12:14:04 EST 2007


Hi Rob,
On Mon, 2007-12-17 at 11:47 -0500, Rob Nielsen wrote:
> I’m running the latest from svn (rev 285). I’ve been having a problem
> launching a process repeatedly. What happens is that I get a debug
> message “some read error” and then the worker refuses to run again.
> 
>  
> 
> I’ve stripped my worker down to just doing a puts and it still
> happens. Like the other threads I want to launch my workers as needed,
> however I get the same behavior whether use the auto_load and ask_work
> or use new_worker with no_auto_load.  If I remove the job_key I can
> get it to work, but I still get the “Some read error” message. I need
> the job to keep one worker per id. I’d rather have separate processes
> than go the thread route – for now.
> 
>  
> 
> class UpdateFacebookAccountInfoWorker < BackgrounDRb::MetaWorker
> 
>   set_worker_name :update_facebook_account_info_worker
> 
>   set_no_auto_load true
> 
>   
> 
>   require "facebook_rails_controller_extensions"
> 
>   include RFacebook  
> 
>   
> 
>   require 'activemessaging/processor'
> 
>   include ActiveMessaging::MessageSender
> 
>  
> 
>   def create(args)
> 
>     puts "create=>"+ args.inspect
> 
>     exit!
> 
>   end
> 
> end
> 
>  
> 
> and the call…
> 
>  
> 
>       MiddleMan.new_worker( 
> 
>         :worker => :update_facebook_account_info_worker,
> 
>         :job_key => @some.id, # Only run one worker per id
> 
>         :data => { 
> 
>           :session_key => @session_key,
> 
>           :requesting_fb_id => @organizer.facebook_id, 
> 
>           :facebook_ids => @fb_ids,
> 
>           :params => params
> 
>         }
> 
>       )
> 
>  
> 
> The output…
> 
>  
> 
> create=>{:params=>REDACTED]}
> 
> Some read error
> 
> Some read error
> 
> Some read error
> 
>  

Ok so, create method is getting invoked when you invoke:

MiddleMan.new_worker(...)

right?

Now, next i see an "exit!" statement there, which basically asks the
worker to quit. Now when a worker quits, master process gets an error
when reading from that socket, so thats why you are getting "some read
error" message. But as far as I can see, create method is getting called
alright. Correct me, If i am wrong.




> 
-- 
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.

http://gnufied.org



More information about the Backgroundrb-devel mailing list