Whamcloud - gitweb
LU-12080 lnet: recovery event handling broken 28/36028/6
authorAmir Shehata <ashehata@whamcloud.com>
Sun, 17 Mar 2019 15:16:40 +0000 (08:16 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 18 Sep 2019 04:23:02 +0000 (04:23 +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.

Lustre-change: https://review.whamcloud.com/34445
Lustre-commit: 5409e620e0256dc9b657f1c457541d7411b543cd

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: I4877caebcac5cdfc35a59a18a3e3451b1f23cb0d
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36028
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-move.c
lnet/lnet/lib-msg.c

index ad86638..74e8ba7 100644 (file)
@@ -3459,7 +3459,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;
 
@@ -3491,7 +3491,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;
@@ -3535,14 +3536,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 6b0af10..af5295b 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);
 }