summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-31 11:15:27 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-31 11:01:31 -0700
commit0b6e1ca3694201814fa4e32d81fa281290fd8ad9 (patch)
tree825fce5b4af71e2a7484fbe74900a48f8396423a /xlators/mgmt/glusterd/src/glusterd3_1-mops.c
parentc9d43f40282af3b3b0c6675e587c573941192769 (diff)
mgmt/glusterd: prevent a double reply for the same request.
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1401 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1401
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c12
1 files changed, 10 insertions, 2 deletions
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;
}