naidu / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

distcc tries to cork ssh connections #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Answering the following questions is a big help:

>1. What version of distcc are you using (e.g. "2.7.1")?  You can run "distcc 
--version" to see.  If you got distcc from a distribution package rather than 
building from source, please say which one.
distcc 3.1 x86_64-pc-linux-gnu
  (protocols 1, 2 and 3) (default port 3632)
  built Jan  5 2011 10:03:35

2. What platform are you running on (e.g. "Red Hat 8.0", "HP-UX 11.11")?  What 
compilare are you using ("gcc 3.3")?  Run "uname -a" and "cc --version" to see.
Debian Squeeze
gcc (Debian 4.4.5-6) 4.4.5

3. What were you trying to do (e.g. "install distcc", "build Mozilla")?
Build Ceph, the distributed filesystem, using distcc over ssh (we just switched 
to ssh from tcp).

4. What went wrong?  Did you get an error message, did it hang, did it build a 
program that didn't work, did it not distribute compilation to machines that 
ought to get it?

"distccd[3811] (tcp_cork_sock) Warning: setsockopt(corked=1) failed: Socket 
operation on non-socket"
This is apparently harmless, but irritating. Setting DISTCC_TCP_CORK=0 in my 
environment did not appear to impact the output either.
Googling for this phrase indicates a few other people having difficult turning 
it off, but it's not showing up in a search of your bug tracker and I couldn't 
find it in your mailing list, so here's a bug.

Original issue reported on code.google.com by gfar...@gmail.com on 4 Mar 2011 at 12:22

GoogleCodeExporter commented 9 years ago
This message is coming from distccd, not from distcc.
To avoid it, you would need to arrange for DISTCC_TCP_CORK=0 to be set in the 
environment on the remote machines before starting the distccd server 
processes, e.g. in /etc/init.d/distcc, and then you would need to restart the 
distccd server processes, e.g. by sudo /etc/init.d/distcc restart.

Original comment by fer...@google.com on 4 Mar 2011 at 4:43

GoogleCodeExporter commented 9 years ago
Well that's helpful in working around the problem, and I'll definitely do that 
(thanks!). But if we're connecting to the distccd via a supported option it 
probably shouldn't be spitting warning messages back at us. :)

Original comment by gfar...@gmail.com on 4 Mar 2011 at 4:59

GoogleCodeExporter commented 9 years ago
So far I didn't manage to disable the warning in SSH mode. (Even tried 
diverting the binary itself, and replaced it with a shell script wrapper that 
exports DISTCC_TCP_CORK=0).

Please just remove that annoying warning, it is absolutely useless.

Original comment by stefan.b...@gmail.com on 21 Sep 2013 at 9:22

GoogleCodeExporter commented 9 years ago
Hi Stefan,

Figured I'd pass this along... I ran into the same issue you did building out a 
distcc farm at my work.  To squash the issue (on a Linux box, at least) - 
requires root access:

1)  mv /usr/bin/distccd /usr/bin/distccd-bin
2)  Put a new file in place at /usr/bin/distccd, with contents like this:
#!/bin/bash
export DISTCC_TCP_CORK=0
exec /usr/bin/distccd-bin $@
3)  chmod 755 /usr/bin/distccd

At that point, this little bash script will intercept calls to distccd, export 
the Env Var properly, then invoke the distccd-bin and preserve all the original 
command line arguments.

I've rolled this change out to a dozen distcc worker nodes here at my work, and 
have seen no further evidence of the TCP cork warnings in any of my builds.  
It's not trivial to roll out, but it will eliminate the noise in your build 
logs until such time as a fix is available.

Original comment by kbpe...@gmail.com on 23 Oct 2013 at 8:09

GoogleCodeExporter commented 9 years ago
The function 

int tcp_cork_sock(int POSSIBLY_UNUSED(fd), int POSSIBLY_UNUSED(corked))

checks the value of DISTCC_TCP_CORK and does nothing (return) if it is not 
enabled.

if (!dcc_getenv_bool("DISTCC_TCP_CORK", 1))
        return 0;

Otherwise it tries to set cork to the provided "corcked" value.  WHen that 
fails we see the error 

I have definitely set DISTCC_TCP_CORK=0, yet I still see these messages all the 
time.  

Original comment by Smith.Ja...@gmail.com on 29 May 2015 at 3:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

builder2:~>sudo systemctl status distccd
[sudo] password for genius: 
● distccd.service - Distccd A Distributed Compilation Server
   Loaded: loaded (/usr/lib/systemd/system/distccd.service; enabled)
   Active: active (running) since Tue 2015-06-02 16:03:29 CEST; 6 days ago
 Main PID: 1182 (distccd)
   CGroup: /system.slice/distccd.service
           ├─1182 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...
           ├─1186 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...
           ├─1257 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...
           ├─1258 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...
           ├─1266 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...
           └─1356 /usr/bin/distccd --verbose --no-detach --daemon --verbose --nice 5 --jobs ...

builder2:~>sudo cat /proc/1182/environ 
LANG=en_US.UTF-8PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/binHOME=/LOGN
AME=nobodyUSER=nobodySHELL=/sbin/nologinOPTIONS=--verbose --nice 5 --jobs 5 
--allow 10.8.0.0/16DISTCC_TCP_CORK=0

journalctl snippet

Jun 09 15:05:30 builder2 distccd[29274]: (tcp_cork_sock) Warning: 
setsockopt(corked=1) failed: Socket operation on non-socket
Jun 09 15:05:30 builder2 distccd[29274]: (dcc_job_summary) client: NOTSOCKET 
COMPILE_OK exit:0 sig:0 core:0 ret:0 time:17260ms 
/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-
Jun 09 15:05:31 builder2 distccd[29242]: (tcp_cork_sock) Warning: 
setsockopt(corked=0) failed: Socket operation on non-socket
Jun 09 15:05:31 builder2 distccd[29242]: (dcc_job_summary) client: NOTSOCKET 
COMPILE_OK exit:0 sig:0 core:0 ret:0 time:17506ms 
/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-
Jun 09 15:05:31 builder2 sshd[29230]: Received disconnect from X.X.X.X: 11: 
disconnected by user

Original comment by Smith.Ja...@gmail.com on 9 Jun 2015 at 1:29