Whamcloud - gitweb
LU-12080 lnet: recovery event handling broken 45/34445/7
authorAmir Shehata <ashehata@whamcloud.com>
Sun, 17 Mar 2019 15:16:40 +0000 (08:16 -0700)
committerAmir Shehata <ashehata@whamcloud.com>
Fri, 7 Jun 2019 17:59:36 +0000 (17:59 +0000)
Don't increment health on unlink event.
If a SEND fails an unlink will follow so no need to do any
special processing on SEND event. If SEND succeeds then we
wait for the reply.
When queuing a message on the NI recovery queue only do so
if the MT thread is still running.

Test-Parameters: forbuildonly
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: I4877caebcac5cdfc35a59a18a3e3451b1f23cb0d
Reviewed-on: https://review.whamcloud.com/34445
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Tested-by: Jenkins
lnet/lnet/lib-move.c
lnet/lnet/lib-msg.c

index 41ab43a..ac16237 100644 (file)
@@ -3453,7 +3453,7 @@ fail_error:
 
 static void
 lnet_handle_recovery_reply(struct lnet_mt_event_info *ev_info,
-                          int status)
+                          int status, bool unlink_event)
 {
        lnet_nid_t nid = ev_info->mt_nid;
 
@@ -3485,7 +3485,8 @@ lnet_handle_recovery_reply(struct lnet_mt_event_info *ev_info,
                 * carry forward too much information.
                 * In the peer case, it'll naturally be incremented
                 */
-               lnet_inc_healthv(&ni->ni_healthv);
+               if (!unlink_event)
+                       lnet_inc_healthv(&ni->ni_healthv);
        } else {
                struct lnet_peer_ni *lpni;
                int cpt;
@@ -3529,14 +3530,14 @@ lnet_mt_event_handler(struct lnet_event *event)
                CDEBUG(D_NET, "%s recovery ping unlinked\n",
                       libcfs_nid2str(ev_info->mt_nid));
        case LNET_EVENT_REPLY:
-               lnet_handle_recovery_reply(ev_info, event->status);
+               lnet_handle_recovery_reply(ev_info, event->status,
+                                          event->type == LNET_EVENT_UNLINK);
                break;
        case LNET_EVENT_SEND:
                CDEBUG(D_NET, "%s recovery message sent %s:%d\n",
                               libcfs_nid2str(ev_info->mt_nid),
                               (event->status) ? "unsuccessfully" :
                               "successfully", event->status);
-               lnet_handle_recovery_reply(ev_info, event->status);
                break;
        default:
                CERROR("Unexpected event: %d\n", event->type);
index 3497157..be2f94a 100644 (file)
@@ -516,6 +516,11 @@ lnet_handle_remote_failure(struct lnet_peer_ni *lpni)
                return;
 
        lnet_net_lock(0);
+       /* the mt could've shutdown and cleaned up the queues */
+       if (the_lnet.ln_mt_state != LNET_MT_STATE_RUNNING) {
+               lnet_net_unlock(0);
+               return;
+       }
        lnet_handle_remote_failure_locked(lpni);
        lnet_net_unlock(0);
 }