[distcc] Problem with distcc doing remote compiles locally

Martin Pool mbp at sourcefrog.net
Thu Mar 2 23:04:44 GMT 2006


On  2 Mar 2006, Victor Norman <vtnpgh at yahoo.com> wrote:
> I am having a problem right now with my distcc not being able to run compiles
> in which it chooses a distccd that happens to be on the same machine.  Whenever
> the local machine is chosen, the distcc verbose output shows:
> 
> 
> distcc[7434] (dcc_connect_by_addr) started connecting to 10.90.2.68:3632
> distcc[7434] ERROR: failed to connect to 10.90.2.68:3632: File exists
> 
> or, after manually having deleted the lock/state directory before starting the compile:
> 
> distcc[10729] (dcc_connect_by_addr) started connecting to 10.90.2.68:3632
> distcc[10729] ERROR: failed to connect to 10.90.2.68:3632: No such file or directory

I think there is a bug in the select-for-write loop that Dan added to
dcc_connect_by_addr:

       if (failed == -1 && errno != EINPROGRESS) {
           rs_log(RS_LOG_ERR|RS_LOG_NONAME,
                  "failed to connect to %s: %s", s, strerror(errno));
           ret = EXIT_CONNECT_FAILED;
           goto out_failed;
       }

'failed' is set by the original call to connect(), but errno will be
reassigned by the various other calls done inside the loop.  (I think
strictly it is undefined except immediately after a library/system call
that fails?)   At any rate it seems risky.

Perhaps that check should be hoisted out of the loop.  Inside the loop
we can just keep select()ing and checking for errors until we either
timeout, fail or connect.

Victor, could you test that?

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/distcc/attachments/20060303/825c35a1/attachment.bin


More information about the distcc mailing list