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