Bug 762256 (GLUSTER-524) - TCP_NODELAY not set when expected on client
Summary: TCP_NODELAY not set when expected on client
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-524
Product: GlusterFS
Classification: Community
Component: protocol
Version: mainline
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Vijay Bellur
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-07 20:09 UTC by Jeff Darcy
Modified: 2015-12-01 16:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

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.)


Note You need to log in before you can comment on or make changes to this bug.