summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2019-03-01 13:41:24 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2019-04-08 14:16:19 +0000
commite1eee0caf6c963ab32dc202ad7e1ecb81675ec49 (patch)
treebaa67f7a66892aaa859f373126da7c6c293f01ac /libglusterfs
parent3687004516e0fc42f1c21f38407d4def7298d6cd (diff)
glusterfsd: Multiple shd processes are spawned on brick_mux environment
Problem: Multiple shd processes are spawned while starting volumes in the loop on brick_mux environment.glusterd spawn a process based on a pidfile and shd daemon is taking some time to update pid in pidfile due to that glusterd is not able to get shd pid Solution: Commit cd249f4cb783f8d79e79468c455732669e835a4f changed the code to update pidfile in parent for any gluster daemon after getting the status of forking child in parent.To resolve the same correct the condition update pidfile in parent only for glusterd and for rest of the daemon pidfile is updated in child > Change-Id: Ifd14797fa949562594a285ec82d58384ad717e81 > fixes: bz#1684404 > Signed-off-by: Mohit Agrawal <moagrawal@redhat.com> > (cherry picked from commit 66986594a9023c49e61b32769b7e6b260b600626) Change-Id: Ie0aa2aebd2b92e114a49777a169b600f3a7163f9 fixes: bz#1696147 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index eefb5f159fe..ad3d308d92a 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4066,7 +4066,6 @@ gf_is_service_running(char *pidfile, int *pid)
ret = lockf(fno, F_TEST, 0);
if (ret == -1) {
running = _gf_true;
- goto out;
}
ret = fscanf(file, "%d", pid);
@@ -4074,6 +4073,8 @@ gf_is_service_running(char *pidfile, int *pid)
gf_msg("", GF_LOG_ERROR, errno, LG_MSG_FILE_OP_FAILED,
"Unable to read pidfile: %s", pidfile);
*pid = -1;
+ running = _gf_false;
+ goto out;
}
running = gf_is_pid_running(*pid);