@@ -492,44 +492,42 @@ static ucs_status_t
492492ucp_worker_iface_handle_uct_ep_failure (ucp_ep_h ucp_ep , ucp_lane_index_t lane ,
493493 uct_ep_h uct_ep , ucs_status_t ep_status )
494494{
495- ucp_wireup_ep_t * wireup_ep ;
496495 ucs_status_t status = UCS_OK ;
496+ ucp_wireup_ep_t * wireup_ep ;
497497 int ft_available ;
498498
499499 ft_available = ucp_worker_iface_ft_available (ucp_ep , uct_ep );
500- if (ucp_ep -> flags & UCP_EP_FLAG_FAILED ) {
501- if (!ft_available ) {
500+ if (!ft_available ) {
501+ status = ucp_worker_uct_ep_outstanding_purge (uct_ep , ep_status );
502+ } else {
503+ status = uct_ep_invalidate (uct_ep , NULL );
504+ if (status != UCS_OK ) {
505+ ucs_error ("failed to invalidate UCT EP %p: %s" , uct_ep ,
506+ ucs_status_string (status ));
502507 status = ucp_worker_uct_ep_outstanding_purge (uct_ep , ep_status );
503508 }
509+ }
504510
511+ if (ucp_ep -> flags & UCP_EP_FLAG_FAILED ) {
505512 /* No pending operations should be scheduled */
506513 uct_ep_pending_purge (uct_ep , ucp_destroyed_ep_pending_purge , ucp_ep );
507514 return status ;
508515 }
509516
510- if (ft_available ) {
511- status = uct_ep_invalidate (uct_ep , NULL );
512- if (status != UCS_OK ) {
513- ucs_error ("failed to invalidate UCT EP %p: %s" , uct_ep ,
514- ucs_status_string (status ));
515- return status ;
516- }
517- }
518-
519517 wireup_ep = ucp_wireup_ep (ucp_ep_get_lane (ucp_ep , lane ));
520518 if ((wireup_ep == NULL ) ||
521519 !ucp_wireup_aux_ep_is_owner (wireup_ep , uct_ep ) ||
522520 !ucp_ep_is_local_connected (ucp_ep )) {
523521 /* Failure on NON-AUX EP or failure on AUX EP before it sent its address
524522 * means failure on the UCP EP */
525523 ucp_ep_set_lanes_failed (ucp_ep , UCS_BIT (lane ), ep_status );
526- goto out ;
524+ return status ;
527525 }
528526
529527 if (wireup_ep -> flags & UCP_WIREUP_EP_FLAG_READY ) {
530528 /* @ref ucp_wireup_ep_progress was scheduled, wireup ep and its
531529 * pending requests have to be handled there */
532- goto out ;
530+ return status ;
533531 }
534532
535533 /**
@@ -541,12 +539,6 @@ ucp_worker_iface_handle_uct_ep_failure(ucp_ep_h ucp_ep, ucp_lane_index_t lane,
541539 ucp_wireup_ep_discard_aux_ep (wireup_ep , UCT_FLUSH_FLAG_CANCEL ,
542540 ucp_destroyed_ep_pending_purge , ucp_ep );
543541 ucp_wireup_remote_connected (ucp_ep );
544-
545- out :
546- if (!ft_available ) {
547- status = ucp_worker_uct_ep_outstanding_purge (uct_ep , ep_status );
548- }
549-
550542 return status ;
551543}
552544
@@ -606,8 +598,9 @@ ucp_worker_iface_error_handler(void *arg, uct_ep_h uct_ep, ucs_status_t status)
606598 if (ucp_worker_is_uct_ep_discarding (worker , uct_ep )) {
607599 ucs_debug ("UCT EP %p is being discarded on UCP Worker %p" ,
608600 uct_ep , worker );
609- status = ucp_worker_uct_ep_outstanding_purge (uct_ep , status );
601+ ( void ) ucp_worker_uct_ep_outstanding_purge (uct_ep , status );
610602 ucp_discard_lane_ff (uct_ep );
603+ status = UCS_OK ;
611604 goto out ;
612605 }
613606
0 commit comments