summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-handshake.c
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-10-02 08:54:28 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-10-08 15:45:47 +0000
commit5bc4594dabc08fd4de1940c044946e33037f2ac7 (patch)
treee3cd2c75a36c0a9da094818a5906ac40376be1d5 /xlators/protocol/server/src/server-handshake.c
parent31b6308c646a84c5064d2fb31dc45363a71b131a (diff)
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 <moagrawal@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r--xlators/protocol/server/src/server-handshake.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index 30e7e4b..9ba6f0b 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;"