summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorKevin Vigor <kvigor@fb.com>2016-09-16 14:13:40 -0700
committerKevin Vigor <kvigor@fb.com>2016-12-16 13:35:09 -0800
commit81b671693c0015dd9f7acf818488118dbd61a6b0 (patch)
tree170f33302af5d095df7fd39338ecce23a8559c95 /rpc
parentc0f0d9f6776a8f26d946be851fabf56af22598d3 (diff)
Fix deadlock observed in T13390459
Summary: Fix deadlock in ping timer callback. Test Plan: run, mount volume. Reviewers: rwareing Reviewed By: rwareing Differential Revision: https://phabricator.intern.facebook.com/D3744945 Signature: t1:3744945:1474061471:3e3d1a5cefc541d26973535887c1f08c017fc049 Change-Id: Iaf94eb4c3acaa8b3ceeeb6a273db4109eea29a7c Signed-off-by: Kevin Vigor <kvigor@fb.com> Reviewed-on: http://review.gluster.org/16168 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Shreyas Siravara <sshreyas@fb.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt-ping.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c
index 91a2ab84140..d999adddb7f 100644
--- a/rpc/rpc-lib/src/rpc-clnt-ping.c
+++ b/rpc/rpc-lib/src/rpc-clnt-ping.c
@@ -187,6 +187,7 @@ rpc_clnt_ping_cbk (struct rpc_req *req, struct iovec *iov, int count,
int64_t latency_msec = 0;
int ret = 0;
int unref = 0;
+ gf_boolean_t call_notify = _gf_false;
if (!myframe) {
gf_log (THIS->name, GF_LOG_WARNING,
@@ -210,12 +211,6 @@ rpc_clnt_ping_cbk (struct rpc_req *req, struct iovec *iov, int count,
"Ping latency is %" PRIu64 "ms",
latency_msec);
- ret = local->rpc->notifyfn (local->rpc, NULL, RPC_CLNT_PING,
- NULL);
- if (ret)
- gf_log (this->name, GF_LOG_WARNING,
- "RPC_CLNT_PING notify failed");
-
if (req->rpc_status == -1) {
unref = rpc_clnt_remove_ping_timer_locked (local->rpc);
if (unref) {
@@ -242,6 +237,15 @@ rpc_clnt_ping_cbk (struct rpc_req *req, struct iovec *iov, int count,
}
unlock:
pthread_mutex_unlock (&conn->lock);
+
+ if (call_notify) {
+ ret = local->rpc->notifyfn (local->rpc, this,
+ RPC_CLNT_PING, NULL);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "RPC_CLNT_PING notify failed");
+ }
+ }
out:
if (unref)
rpc_clnt_unref (local->rpc);