summaryrefslogtreecommitdiffstats
path: root/cli/src/cli.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-08-24 08:07:14 +0530
committergluster-ant <bugzilla-bot@gluster.org>2015-08-24 08:07:14 +0530
commit8ea6b4e8a8370ecbfd5ace5e14fa97c910fc02ae (patch)
tree7c0d6fbb68cb9c11d76137230e57054ce8125aa1 /cli/src/cli.c
parentee222028e4f425427a6d9cff17ce2bd2417e8fa2 (diff)
cli: on error invoke cli_cmd_broadcast_response function in separate thread
There is a problem in current CLI framework CLI holds the lock when processing command. When processing quota list command, below sequence of steps executed in the same thread and causing deadlock 1) CLI holds the lock 2) Send rpc_clnt_submit request to quotad for quota usage 3) If quotad is down, rpc_clnt_submit invokes cbk function with error 4) cbk function cli_quotad_getlimit_cbk tries to hold lock to broadcast the results and hangs, because same thread has already holding the lock This patch fixes the problem by creating seperate thread for broadcasting the result Change-Id: I53be006eadf6aaf348083d9168535530d70a8ab3 BUG: 1242819 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11990 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'cli/src/cli.c')
-rw-r--r--cli/src/cli.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 3a27a3e708..5707d3fbdd 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -652,6 +652,7 @@ cli_local_get ()
cli_local_t *local = NULL;
local = GF_CALLOC (1, sizeof (*local), cli_mt_cli_local_t);
+ LOCK_INIT (&local->lock);
return local;
}