summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index b86a8440458..720e8955b68 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -5227,13 +5227,16 @@ find_compat_brick_in_vol (glusterd_conf_t *conf,
* wait for the pidfile to be populated with a value before
* checking if the service is running */
while (retries > 0) {
- if (sys_access (pidfile2, F_OK) == 0)
+ if (sys_access (pidfile2, F_OK) == 0 &&
+ gf_is_service_running (pidfile2, &pid2)) {
break;
+ }
+
sleep (1);
retries--;
}
- if (!gf_is_service_running (pidfile2, &pid2)) {
+ if (retries == 0) {
gf_log (this->name, GF_LOG_INFO,
"cleaning up dead brick %s:%s",
other_brick->hostname, other_brick->path);