[distcc] Re: distcc host selection algorithm is too naive

Martin Pool mbp at samba.org
Mon Feb 17 03:46:47 GMT 2003

On 17 Feb 2003, Peter Hawkins <peter at hawkins.emu.id.au> wrote:

> However, as you correctly observed, the locking isn't done correctly -
> because the lock name does not include the port number. Hence all of the
> hosts in the list compete for the same set of locks (and the first
> machine wins in almost every case). A random selection algorithm helped,
> because it meant that the jobs were usually spread over 4 machines, not
> just 1.

Ah, OK.

> A patch to add the port number to the lock name is attached.

Thanks, but this is already fixed in 1.2cvs.

I hope to have first-class support for ssh really soon, as soon as I
stop getting distracted by scheduling. :-)

Any other observations you have about scheduling are welcome.  It is a
bit hard to have something that is simple and also works on all
different setups, but it can probably be better.  In particular if you
could test CVS on your network that would be great.

>      tempdir = dcc_get_tempdir();
> -    need_len = strlen(tempdir) + 6 + strlen(host) + 1 + 7 + 1;
> +    need_len = strlen(tempdir) + 6 + strlen(host) + 1 + 5 + 1 + 7 + 1;
>      buf = malloc(need_len);

Ew, gross.  I don't believe I wrote that. :-) 

CVS uses asprintf and includes an implementation for legacy systems
like Solaris. ;-)


More information about the distcc mailing list