f338ef
From 913a0dc8f1eaa2fb18a6ebd6fcf66f46b48039f1 Mon Sep 17 00:00:00 2001
f338ef
From: Mohit Agrawal <moagrawal@redhat.com>
f338ef
Date: Wed, 18 Sep 2019 19:11:33 +0530
f338ef
Subject: [PATCH 301/302] posix: Brick is going down unexpectedly
f338ef
f338ef
Problem: In brick_mux environment, while multiple volumes are
f338ef
         created (1-1000) sometimes brick is going down due to
f338ef
         health_check thread failure
f338ef
f338ef
Solution: Ignore EAGAIN error in health_check thread code to
f338ef
          avoid the issue
f338ef
f338ef
> Change-Id: Id44c59f8e071a363a14d09d188813a6633855213
f338ef
> Fixes: bz#1751907
f338ef
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
f338ef
> (Cherry picked from commit c4d926900dc36f71c04b3f65ceca5150ce0e8c81)
f338ef
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23437/)
f338ef
f338ef
Change-Id: Id44c59f8e071a363a14d09d188813a6633855213
f338ef
BUG: 1731826
f338ef
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/182106
f338ef
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
f338ef
---
f338ef
 xlators/storage/posix/src/posix-helpers.c | 14 ++++++++++----
f338ef
 1 file changed, 10 insertions(+), 4 deletions(-)
f338ef
f338ef
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
f338ef
index 6a1a35c..35dd3b6 100644
f338ef
--- a/xlators/storage/posix/src/posix-helpers.c
f338ef
+++ b/xlators/storage/posix/src/posix-helpers.c
f338ef
@@ -2108,14 +2108,20 @@ out:
f338ef
     if (fd != -1) {
f338ef
         sys_close(fd);
f338ef
     }
f338ef
+
f338ef
     if (ret && file_path[0]) {
f338ef
         gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_HEALTHCHECK_FAILED,
f338ef
                "%s() on %s returned ret is %d error is %s", op, file_path, ret,
f338ef
                ret != -1 ? strerror(ret) : strerror(op_errno));
f338ef
-        gf_event(EVENT_POSIX_HEALTH_CHECK_FAILED,
f338ef
-                 "op=%s;path=%s;error=%s;brick=%s:%s timeout is %d", op,
f338ef
-                 file_path, strerror(op_errno), priv->hostname, priv->base_path,
f338ef
-                 timeout);
f338ef
+
f338ef
+        if ((op_errno == EAGAIN) || (ret == EAGAIN)) {
f338ef
+            ret = 0;
f338ef
+        } else {
f338ef
+            gf_event(EVENT_POSIX_HEALTH_CHECK_FAILED,
f338ef
+                     "op=%s;path=%s;error=%s;brick=%s:%s timeout is %d", op,
f338ef
+                     file_path, strerror(op_errno), priv->hostname,
f338ef
+                     priv->base_path, timeout);
f338ef
+        }
f338ef
     }
f338ef
     return ret;
f338ef
 }
f338ef
-- 
f338ef
1.8.3.1
f338ef