summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/client_t.c
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2019-01-28 21:28:45 +0530
committerAmar Tumballi <amarts@redhat.com>2019-01-31 06:23:39 +0000
commitb41cdeb638f9f9ec2fef13ec95c216faf52a9df9 (patch)
tree65692a065793a0241f0c23375af45bc0b46858cb /libglusterfs/src/client_t.c
parent09db11b0c020bc79d493c6d7e7ea4f3beb000c68 (diff)
core: heketi-cli is throwing error "target is busy"
Problem: When rpc-transport-disconnect happens, server_connection_cleanup_flush_cbk() is supposed to call rpc_transport_unref() after open-files on that transport are flushed per transport.But open-fd-count is maintained in bound_xl->fd_count, which can be incremented/decremented cumulatively in server_connection_cleanup() by all transport disconnect paths. So instead of rpc_transport_unref() happening per transport, it ends up doing it only once after all the files on all the transports for the brick are flushed leading to rpc-leaks. Solution: To avoid races maintain fd_cnt at client instead of maintaining on brick Credits: Pranith Kumar Karampuri Change-Id: I6e8ea37a61f82d9aefb227c5b3ab57a7a36850e6 fixes: bz#1668190 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'libglusterfs/src/client_t.c')
-rw-r--r--libglusterfs/src/client_t.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c
index 0f98a66a123..e875c8b6b69 100644
--- a/libglusterfs/src/client_t.c
+++ b/libglusterfs/src/client_t.c
@@ -224,6 +224,7 @@ gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid,
GF_ATOMIC_INIT(client->bind, 1);
GF_ATOMIC_INIT(client->count, 1);
+ GF_ATOMIC_INIT(client->fd_cnt, 0);
client->auth.flavour = cred->flavour;
if (cred->flavour != AUTH_NONE) {