| Summary: | enable tcp keepalive | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Community] GlusterFS | Reporter: | Krishna Srinivas <krishna> | ||||
| Component: | protocol | Assignee: | Shehjar Tikoo <shehjart> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||
| Severity: | low | Docs Contact: | |||||
| Priority: | urgent | ||||||
| Version: | 3.0.0 | CC: | amarts, anush, gluster-bugs, pavan | ||||
| 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: | RTP | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Krishna Srinivas
2010-03-24 04:10:41 UTC
Customer has a firewall between clients and servers. This firewall breaks idle TCP connections and this causes the first access on the client mount point to return error. Subsequent access works fine. Hence automated scripts that are run the first time after idle connection is broken will fail. Apparently this is a common problem: http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/#preventingdisconnection Fixing this problem in glusterfs is very simple, just call on socket fd: optval = 1; optlen = sizeof(optval); if(setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) { /* ERROR */ } This is very light weight on the network - by default it sends a keepalive packet every 2 hours (configurable in /proc). This will be useful for other customers who have firewalls that terminate idle connections. Krishna Setting p1 to show up in my list of prio bugs Created attachment 204 [details]
Proposed patch (as in full description) as an attachment
Trace of a connection sending keep-alives every ten seconds. View using wireshark.
Option for enabling keep-alive:
option transport.socket.keepalive-interval 10
PATCH: http://patches.gluster.com/patch/3287 in master (socket: Support TCP-KEEPALIVE) PATCH: http://patches.gluster.com/patch/3288 in release-3.0 (socket: Support TCP-KEEPALIVE) PATCH: http://patches.gluster.com/patch/3303 in master (socket: make tcp keepalive work on OS X) PATCH: http://patches.gluster.com/patch/3322 in release-3.0 (socket: make tcp keepalive work on OS X) |