From 04f84756e1baa5eff4560339700f82970eaa5d80 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Tue, 22 Jan 2019 12:57:50 +0530 Subject: core: heketi-cli is throwing error "target is busy" Problem: At the time of deleting block hosting volume through heketi-cli , it is throwing an error "target is busy". cli is throwing an error because brick is not detached successfully and brick is not detached due to race condition to cleanp xprt associated with detached brick Solution: To avoid xprt specifc race condition introduce an atomic flag on rpc_transport Change-Id: Id4ff1fe8375a63be71fb3343f455190a1b8bb6d4 fixes: bz#1668190 Signed-off-by: Mohit Agrawal --- rpc/rpc-lib/src/rpc-transport.c | 1 + rpc/rpc-lib/src/rpc-transport.h | 1 + 2 files changed, 2 insertions(+) (limited to 'rpc/rpc-lib') diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index e6421fcfab5..f9cbdf133c7 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -365,6 +365,7 @@ rpc_transport_load(glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) } INIT_LIST_HEAD(&trans->list); + GF_ATOMIC_INIT(trans->disconnect_progress, 0); return_trans = trans; diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h index 7be1ba14a0c..9e75d1a2bbb 100644 --- a/rpc/rpc-lib/src/rpc-transport.h +++ b/rpc/rpc-lib/src/rpc-transport.h @@ -214,6 +214,7 @@ struct rpc_transport { gf_boolean_t connect_failed; char notify_poller_death; char poller_death_accept; + gf_atomic_t disconnect_progress; }; struct rpc_transport_ops { -- cgit