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