Hide Forgot
The code in socket_connect will only call __socket_nodelay if priv->nodelay *and* priv->lowlat are both set. Leaving aside the case where priv->lowlat is set because transport.socket.lowlat was set in client-protocol:init, the way both of these values are set in socket_init can yield some unexpected results. In the case of lowlat, the value will be set based purely on the *presence* of transport.socket.lowlat, regardless of its value. Thus, even if a user has "option transport.socket.lowlat off" in their config, priv->lowlat will be set. More seriously, a comment in the code to handle transport.socket.nodelay says "By default, we enable NODELAY" but that's not true. If the option is *not provided* then we never get into that block and priv->nodelay remains zero. This causes the later check in socket_connect to fail, so by default we do not set TCP_NODELAY on any client sockets at all. I've verified this in running code, with breakpoints in socket_connect. The fix to the latter problem is simple: move the initialization of priv->nodelay to be above the dict_get block, instead of within it.
PATCH: http://patches.gluster.com/patch/2650 in master (transport/socket: Enable NODELAY even if no option is set.)