Bug 762256 (GLUSTER-524)

Summary: TCP_NODELAY not set when expected on client
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: protocolAssignee: Vijay Bellur <vbellur>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: mainlineCC: aavati, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jeff Darcy 2010-01-07 20:09:30 UTC
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.

Comment 1 Anand Avati 2010-01-12 07:12:53 UTC
PATCH: http://patches.gluster.com/patch/2650 in master (transport/socket: Enable NODELAY even if no option is set.)