From 0b6e1ca3694201814fa4e32d81fa281290fd8ad9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 31 Aug 2010 11:15:27 +0000 Subject: mgmt/glusterd: prevent a double reply for the same request. Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1401 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1401 --- xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c index 3777e699268..ad3eb5cc31e 100644 --- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c +++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c @@ -1215,9 +1215,17 @@ glusterd_handle_rpc_msg (rpcsvc_request_t *req) out: if (ret && is_cli_req) { - glusterd_op_send_cli_response (req->procnum, ret, 0, req); + /* if we are sending a reply here, then return value should + be 0, and we should not point to any RPC errors, because + otherwise rpcsvc.c will send an error reply for the same + request, which causes double replies */ + ret = glusterd_op_send_cli_response (req->procnum, ret, 0, req); + if (!ret) + req->rpc_err = SUCCESS; } - gf_log ("", GF_LOG_NORMAL, "Returning %d", ret); + if (!ret) + gf_log ("", GF_LOG_WARNING, "Returning %d", ret); + return ret; } -- cgit