From 6b3704990257643da54100d8581856a7d2c72f86 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 17 Feb 2015 12:12:11 +0100 Subject: socket: use TCP_USER_TIMEOUT to detect client failures quicker Use the network.ping-timeout to set the TCP_USER_TIMEOUT socket option (see 'man 7 tcp'). The option sets the transport.tcp-user-timeout option that is handled in the rpc/socket layer on the protocol/server side. This socket option makes detecting unclean disconnected clients more reliable. When the socket gets closed, any locks that the client held are been released. This makes it possible to reduce the fail-over time for applications that run on systems that became unreachable due to a network partition or general system error client-side (kernel panic, hang, ...). It is not trivial to create a test-case for this at the moment. We need a client that unclean disconnects and an other client that tries to take over the lock from the disconnected client. URL: http://supercolony.gluster.org/pipermail/gluster-devel/2014-May/040755.html Change-Id: I5e5f540a49abfb5f398291f1818583a63a5f4bb4 BUG: 1129787 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/8065 Tested-by: Gluster Build System Reviewed-by: soumya k Reviewed-by: Santosh Pradhan Reviewed-by: Kaleb KEITHLEY --- xlators/protocol/server/src/server.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/protocol/server') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 023f2a6234f..aea88b623cc 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -1198,6 +1198,12 @@ struct volume_options options[] = { { .key = {"volume-filename.*"}, .type = GF_OPTION_TYPE_PATH, }, + { .key = {"transport.tcp-user-timeout"}, + .type = GF_OPTION_TYPE_TIME, + .min = 0, + .max = 1013, + .default_value = "42", /* default like network.ping-timeout */ + }, { .key = {"transport.*"}, .type = GF_OPTION_TYPE_ANY, }, -- cgit