[Backgroundrb-devel] worker starting twice

Jack Nutting jnutting at gmail.com
Wed Mar 14 10:21:06 EDT 2007

On 3/13/07, Brian Lucas <blucasco at gmail.com> wrote:
> Hi Jack, I'm experiencing the same problem and wrote about it here earlier.
> I wonder if it has something to do with thread_pool size or concurrent
> threads running in brb?

I don't know, but I know it's really irritating.

I think I have a few clues for whoever feels up to looking at this.

First of all, the doubled worker is not actually running in two
processes.  'ps' shows me only the processes i've specified in the
schedules file, not more.  Instead, the trigger method is being called
twice.  Through logging output, I've observed that my loop is in fact
running twice simultaneously, presumably from two different threads.

Also, I've found a way to determine which of my processes will be
doubled:  whichever top-level job entry name (not the job_key, but the
top-level identifier for a worker) comes alphabetically first, that's
the job that I start getting double-invocations on!  e.g. if I have a
job like this:

    :class: :my_class
    :job_key: :my_job1

that won't won't be doubled up (some other worker will instead).
However, if I change the 'zzzzz' to 'a', this worker will be
double-invoked.  In the short term, this gives me a workaround since I
can have a dummy worker called 'a' that just sleeps, but this is still
consuming excess RAM of course.

// jack
// http://www.nuthole.com

More information about the Backgroundrb-devel mailing list