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

hemant kumar gethemant at gmail.com
Mon Dec 17 15:09:14 EST 2007


On Mon, 2007-12-17 at 14:48 -0500, Rob Nielsen wrote:
> 
> -----Original Message-----
> From: hemant kumar [mailto:gethemant at gmail.com] 
> Sent: Monday, December 17, 2007 1:09 PM
> To: Rob Nielsen
> Cc: backgroundrb-devel at rubyforge.org
> Subject: RE: [Backgroundrb-devel] Get "some read error" on calls to
> worker
> 
> 
> On Mon, 2007-12-17 at 12:39 -0500, Rob Nielsen wrote:
> > 
> > -----Original Message-----
> > From: hemant kumar [mailto:gethemant at gmail.com] 
> > Sent: Monday, December 17, 2007 12:36 PM
> > To: Rob Nielsen
> > Cc: backgroundrb-devel at rubyforge.org
> > Subject: RE: [Backgroundrb-devel] Get "some read error" on calls to
> > worker
> > 
> > 
> > On Mon, 2007-12-17 at 12:34 -0500, Rob Nielsen wrote:
> > > 
> > > -----Original Message-----
> > > From: hemant kumar [mailto:gethemant at gmail.com] 
> > > Sent: Monday, December 17, 2007 12:14 PM
> > > To: Rob Nielsen
> > > Cc: backgroundrb-devel at rubyforge.org
> > > Subject: Re: [Backgroundrb-devel] Get "some read error" on calls to
> > > worker
> > > 
> > > Hi Rob,
> > > 
> > > 
> > > [SNIP]
> > > 
> > > 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.
> > > 
> > > ----
> > > 
> > > Yes it gets called once. Subsequent calls fail for some reason. If I
> > > take out the job_key, then I can call it again.
> > 
> > When you can exit! on a worker..its dead, its gone. You can't access
> it
> > any more. You shouldn't call exit! on it, if you want to make further
> > calls to it.
> > 
> > ----
> > Right. But I'm calling new_worker. So that should start a new
> instance.
> > Right?
> > 
> > > 
> 
> Ok, sync with latest svn code and see if its fixed. If not then, come to
> #backgroundrb on freenode.
> 
> ----
> OK that seems to have fixed the issue. Thanks.
> 
> A couple questions: 
> 1. What happens if you do a new_worker with a given job_key while a
> worker with the same key is already running? Does the second task get
> queued or does the request simply wait for the first process to finish?

Currently none of the above happens. Your request will be simply
ignored.
> 
> 2. Does ask_status throw an exception if the worker isn't running? I
> would like to be able to ask if the worker is running before starting
> another one.

Nope, It won't throw any exception in user code. It does throw an
exception internally. However, you can query status of all workers that
are currently running, using 

  MiddleMan.query_all_workers()

See, if that output is helpful.

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