|
| 1 | +diff --git a/src/na/na_ucx.c b/src/na/na_ucx.c |
| 2 | +index 6e9c3b0..2f157da 100644 |
| 3 | +--- a/src/na/na_ucx.c |
| 4 | ++++ b/src/na/na_ucx.c |
| 5 | +@@ -441,6 +441,12 @@ na_ucp_ep_create(ucp_worker_h worker, ucp_ep_params_t *ep_params, |
| 6 | + static void |
| 7 | + na_ucp_ep_error_cb(void *arg, ucp_ep_h ep, ucs_status_t status); |
| 8 | + |
| 9 | ++/** |
| 10 | ++ * Flush endpoint. |
| 11 | ++ */ |
| 12 | ++static ucs_status_ptr_t |
| 13 | ++na_ucp_ep_flush(ucp_ep_h ep); |
| 14 | ++ |
| 15 | + /** |
| 16 | + * Close endpoint. |
| 17 | + */ |
| 18 | +@@ -1940,6 +1946,21 @@ na_ucp_ep_error_cb( |
| 19 | + na_ucx_addr_ref_decr(na_ucx_addr); |
| 20 | + } |
| 21 | + |
| 22 | ++/*---------------------------------------------------------------------------*/ |
| 23 | ++static ucs_status_ptr_t |
| 24 | ++na_ucp_ep_flush(ucp_ep_h ep) |
| 25 | ++{ |
| 26 | ++ const ucp_request_param_t flush_params = { |
| 27 | ++ .op_attr_mask = 0}; |
| 28 | ++ ucs_status_ptr_t status_ptr = ucp_ep_flush_nbx(ep, &flush_params); |
| 29 | ++ |
| 30 | ++ NA_CHECK_SUBSYS_ERROR_DONE(addr, |
| 31 | ++ status_ptr != NULL && UCS_PTR_IS_ERR(status_ptr), |
| 32 | ++ "ucp_ep_flush_nb() failed (%s)", |
| 33 | ++ ucs_status_string(UCS_PTR_STATUS(status_ptr))); |
| 34 | ++ return status_ptr; |
| 35 | ++} |
| 36 | ++ |
| 37 | + /*---------------------------------------------------------------------------*/ |
| 38 | + static void |
| 39 | + na_ucp_ep_close(ucp_ep_h ep) |
| 40 | +@@ -2859,8 +2880,23 @@ na_ucx_addr_release(struct na_ucx_addr *na_ucx_addr) |
| 41 | + if (na_ucx_addr->ucp_ep != NULL) { |
| 42 | + /* NB. for deserialized addresses that are not "connected" addresses, do |
| 43 | + * not close the EP */ |
| 44 | +- if (na_ucx_addr->worker_addr == NULL) |
| 45 | ++ if (na_ucx_addr->worker_addr == NULL) { |
| 46 | ++ if (!na_ucx_addr->na_ucx_class->ucp_listener) { |
| 47 | ++ ucs_status_ptr_t status_ptr = na_ucp_ep_flush(na_ucx_addr->ucp_ep); |
| 48 | ++ |
| 49 | ++ if (UCS_PTR_IS_PTR(status_ptr)) { |
| 50 | ++ ucs_status_t status; |
| 51 | ++ |
| 52 | ++ do { |
| 53 | ++ ucp_worker_progress(na_ucx_addr->na_ucx_class->ucp_worker); |
| 54 | ++ status = ucp_request_check_status(status_ptr); |
| 55 | ++ } while (status == UCS_INPROGRESS); |
| 56 | ++ ucp_request_free(status_ptr); |
| 57 | ++ } |
| 58 | ++ } |
| 59 | ++ |
| 60 | + na_ucp_ep_close(na_ucx_addr->ucp_ep); |
| 61 | ++ } |
| 62 | + na_ucx_addr->ucp_ep = NULL; |
| 63 | + } |
| 64 | + |
0 commit comments