From 5bc4594dabc08fd4de1940c044946e33037f2ac7 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Tue, 2 Oct 2018 08:54:28 +0530 Subject: core: glusterfsd keeping fd open in index xlator Problem: Current resource cleanup sequence is not perfect while brick mux is enabled Solution: 1) Destroying xprt after cleanup all fd associated with a client 2) Before call fini for brick xlators ensure no stub should be running on a brick Change-Id: I86195785e428f57d3ef0da3e4061021fafacd435 fixes: bz#1631357 Signed-off-by: Mohit Agrawal --- xlators/protocol/server/src/server-handshake.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'xlators/protocol/server/src/server-handshake.c') diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 30e7e4b0478..9ba6f0b0a95 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -592,6 +592,7 @@ server_setvolume(rpcsvc_request_t *req) goto fail; } + pthread_mutex_lock(&conf->mutex); list_for_each_entry(tmp, &conf->child_status->status_list, status_list) { if (strcmp(tmp->name, name) == 0) @@ -599,10 +600,8 @@ server_setvolume(rpcsvc_request_t *req) } if (!tmp->name) { - gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED, - "No xlator %s is found in " - "child status list", - name); + gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_CHILD_STATUS_FAILED, + "No xlator %s is found in child status list", name); } else { ret = dict_set_int32(reply, "child_up", tmp->child_up); if (ret < 0) @@ -610,7 +609,21 @@ server_setvolume(rpcsvc_request_t *req) "Failed to set 'child_up' for xlator %s " "in the reply dict", tmp->name); + if (!tmp->child_up) { + ret = dict_set_str(reply, "ERROR", + "Not received child_up for this xlator"); + if (ret < 0) + gf_msg_debug(this->name, 0, "failed to set error msg"); + + gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED, + "Not received child_up for this xlator %s", name); + op_ret = -1; + op_errno = EAGAIN; + pthread_mutex_unlock(&conf->mutex); + goto fail; + } } + pthread_mutex_unlock(&conf->mutex); ret = dict_get_str(params, "process-uuid", &client_uid); if (ret < 0) { @@ -798,8 +811,8 @@ server_setvolume(rpcsvc_request_t *req) req->trans->clnt_options = dict_ref(params); gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_CLIENT_ACCEPTED, - "accepted client from %s (version: %s)", client->client_uid, - (clnt_version) ? clnt_version : "old"); + "accepted client from %s (version: %s) with subvol %s", + client->client_uid, (clnt_version) ? clnt_version : "old", name); gf_event(EVENT_CLIENT_CONNECT, "client_uid=%s;" -- cgit