From b9f1d1a120b4469d51d2a96eecc7ce83516593ba Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 8 Jul 2014 08:18:27 +0530 Subject: rpc: Do not reset @ping_started to 0 in ping callback This is to avoid indefinite recursion of the following kind, that could lead to a stack overflow: rpc_clnt_start_ping() -> rpc_clnt_ping() -> rpc_clnt_submit() -> rpc_clnt_start_ping() -> rpc_clnt_ping() -> rpc_clnt_submit() ... and so on, since it is possible that before rpc_clnt_start_ping() is called a second time by the thread executing this codepath, the response to previous ping request could ALWAYS come by and cause epoll thread to reset conn->ping_started to 0. This patch also fixes the issue of excessive ping traffic, which was due to the client sending one ping rpc for every fop in the worst case. Also removed dead code in glusterd. Change-Id: I7c5e6ae3b1c9d23407c0a12a319bdcb43ba7a359 BUG: 1116243 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/8257 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- rpc/rpc-lib/src/rpc-clnt-ping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/rpc-lib/src/rpc-clnt-ping.h') diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.h b/rpc/rpc-lib/src/rpc-clnt-ping.h index 4edc416cee9..d7cd1d965e5 100644 --- a/rpc/rpc-lib/src/rpc-clnt-ping.h +++ b/rpc/rpc-lib/src/rpc-clnt-ping.h @@ -16,4 +16,4 @@ #define RPC_DEFAULT_PING_TIMEOUT 30 void -rpc_clnt_start_ping (void *rpc_ptr); +rpc_clnt_check_and_start_ping (struct rpc_clnt *rpc_ptr); -- cgit