From c4d926900dc36f71c04b3f65ceca5150ce0e8c81 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Wed, 18 Sep 2019 19:11:33 +0530 Subject: posix: Brick is going down unexpectedly Problem: In brick_mux environment, while multiple volumes are created (1-1000) sometimes brick is going down due to health_check thread failure Solution: Ignore EAGAIN error in health_check thread code to avoid the issue Change-Id: Id44c59f8e071a363a14d09d188813a6633855213 Fixes: bz#1751907 Signed-off-by: Mohit Agrawal --- xlators/storage/posix/src/posix-helpers.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 6c5449083f3..1d9361aa057 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2120,14 +2120,20 @@ out: if (fd != -1) { sys_close(fd); } + if (ret && file_path[0]) { gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_HEALTHCHECK_FAILED, "%s() on %s returned ret is %d error is %s", op, file_path, ret, ret != -1 ? strerror(ret) : strerror(op_errno)); - gf_event(EVENT_POSIX_HEALTH_CHECK_FAILED, - "op=%s;path=%s;error=%s;brick=%s:%s timeout is %d", op, - file_path, strerror(op_errno), priv->hostname, priv->base_path, - timeout); + + if ((op_errno == EAGAIN) || (ret == EAGAIN)) { + ret = 0; + } else { + gf_event(EVENT_POSIX_HEALTH_CHECK_FAILED, + "op=%s;path=%s;error=%s;brick=%s:%s timeout is %d", op, + file_path, strerror(op_errno), priv->hostname, + priv->base_path, timeout); + } } return ret; } -- cgit