From 14e24da1eb59a85fe99c22bafd8641ca2b75a923 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Mon, 28 Mar 2016 14:17:53 -0700 Subject: event: Idle connection management Summary: - This diff adds support for detecting and tracking idle client connections. - It allows *service translators* (server, nfs) to opt-in to detect and close idle client connections. - Right now it explicitly restricts the service to NFS as a safety. Here are the debug logs when a client connection gets closed: [2016-03-29 17:27:06.154232] W [socket.c:2426:socket_timeout_handler] 0-socket: Shutting down idle client connection (idle=20s,fd=20,conn=[2401:db00:11:d0af:face:0:3:0:957]->[2401:db00:11:d0af:face:0:3:0:2049])! [2016-03-29 17:27:06.154292] D [event-epoll.c:655:__event_epoll_timeout_slot] 0-epoll: Connection on slot->fd=9 was idle for 20 seconds! [2016-03-29 17:27:06.163282] D [socket.c:629:__socket_rwv] 0-socket.nfs-server: EOF on socket [2016-03-29 17:27:06.163298] D [socket.c:2474:socket_event_handler] 0-transport: disconnecting now [2016-03-29 17:27:06.163316] D [event-epoll.c:614:event_dispatch_epoll_handler] 0-epoll: generation bumped on idx=9 from gen=4 to slot->gen=5, fd=20, slot->fd=20 Test Plan: - Used stuck NFS mounts to create idle clients and unstuck them. Reviewers: kvigor, rwareing Reviewed By: rwareing Subscribers: dld, moox, dph Differential Revision: https://phabricator.fb.com/D3112099 Change-Id: Ic06c89e03f87daabab7f07f892390edd1a1fcc20 Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/18265 Reviewed-by: Jeff Darcy Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Smoke: Gluster Build System --- cli/src/cli-rl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-rl.c b/cli/src/cli-rl.c index bca37d9c509..e1e087f013a 100644 --- a/cli/src/cli-rl.c +++ b/cli/src/cli-rl.c @@ -387,7 +387,7 @@ cli_rl_enable (struct cli_state *state) goto out; } - ret = event_register (state->ctx->event_pool, 0, cli_rl_stdin, state, + ret = event_register (state->ctx->event_pool, 0, cli_rl_stdin, NULL, state, 1, 0); if (ret == -1) goto out; -- cgit