[Backgroundrb-devel] BackgrounDRb newbie stuck at first base. Fresh pair of eyes needed

Chris T ctmailinglists at googlemail.com
Fri Oct 13 05:13:28 EDT 2006

Ezra Zygmuntowicz wrote:
> On Oct 12, 2006, at 12:28 PM, Chris T wrote:
>> Ezra Zygmuntowicz wrote:
>>> On Oct 12, 2006, at 9:37 AM, Frederick Cheung wrote:
>>>> On 12 Oct 2006, at 16:18, Chris T wrote:
>>>>> Can't believe I can't see the problem here, but after a few hours
>>>>> bashing my head on a brick wall, going to risk looking stupid by
>>>>> seeing
>>>>> if anyone can point out my idiocy (that's the worst thing about 
>>>>> coding
>>>>> on your own).
>>>> Random guess: you haven't restarted the backgroundrb process since
>>>> you've added the progress method ?
>>>> Fred
>>>     Also I am not entirely sure that you can use respond_to? across 
>>> a drb connection like that. Because drb uses method missing 
>>> internally to dispatch across the wire it won't be able to 
>>> respond_to? what you are trying to do. Is it just the test case that 
>>> is failing?
>>> -EZra
>> Ezra
>> I've tried doing this through the console, just to see where the prob 
>> is, but keep having difficulties with all the requires. Do I need to 
>> do all the requires in the test case, including requiring the worker? 
>> Keep getting uninitialized constant... Could that be a clue, or won't 
>> it work via the console.
>> Cheers for your help
>> Chris
> Chris-
>     It will work fine from the console as long as the backgroundrb 
> server is running before you start script/console then you can just 
> access the MidleMan directly. Make sure you have entirely killed the 
> drb server and then restart it and drop into script/console and try it 
> from there. Does it work if you try to use one of the example workers 
> at all? Have you ever had the plugin working yet and just now its 
> broken or what? Also I see in your unit test that you are testing for 
> hse_notices_retrieved but you didnt make an attr_accessor for it. From 
> what you have showed me I don't see any reason why it shouldn't be 
> working. Make sure that you have really killed the server and then 
> restart it and try again.
> -Ezra
OK. Sorted this now. It was one those those multiple bugs -- where a 
whole lot of things were not working quite right, and so making it 
difficult to zero in on the problem.

First, the problems were hidden by two things -- I was running autotest 
in the background, which was of course rerunning the test every time I 
changed anything. Second, I had got the sleep set to the default of 60, 
so the worker wasn't always dead by the time the test was re-run [Note 
to self: not much point in having TTL less than the sleep time]. 
Sometime it was, sometime it wasn't. Result: inconsistency in error 

Third, when trying different combinations of things, I tried not 
submitting any args. Result: more apparent (though not actual) 
weirdness: of course the line @message = args[:message] || "" fails 
because args is then nil, not an empty Hash, so the setup fails at that 
point. Hence, why it wasn't responding to the accessor methods.

Finally, I hadn't really appreciated (i.e. it hadn't properly sunk in) 
that you had to restart backgroundrb every time you made a change in the 
worker class. I thought I was doing it, but wit all the inconsistency, 
I'm now not 100% sure.

Anyway, all working now. For future ref the respond_to? works fine as a 
way of testing the accessor methods have been loaded OK, and I'd advise 
anyone who is running autotest to turn it off while debugging worker 
classes -- the combination of TTL, sleep, quickly running tests, and the 
need to restart  backgroundrb makes life way to messy.

Thanks for your help, and thanks for the plugin.

p.s. Is it possible to have different configs for development, test and 

More information about the Backgroundrb-devel mailing list