Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit e89e847

Browse files
committed
btl/ugni: fix another connection race
This commit fixes a race that can occur when two threads are in the ugni progress function at the same time. This race occurs when one thread calls GNI_PostDataProbeById then goes to sleep then another thread calls GNI_PostDataProbeById then GNI_EpPostDataWaitById before the other thread wakes up. If this happens the first thread will print a warning on GNI_EpPostDataWaitById about no matching post. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit adb6682)
1 parent a5cc6aa commit e89e847

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

opal/mca/btl/ugni/btl_ugni_component.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ mca_btl_ugni_progress_datagram (mca_btl_ugni_module_t *ugni_module)
398398
/* check for datagram completion */
399399
OPAL_THREAD_LOCK(&ugni_module->device->dev_lock); /* TODO: may not need lock for this function */
400400
grc = GNI_PostDataProbeById (ugni_module->device->dev_handle, &datagram_id);
401-
OPAL_THREAD_UNLOCK(&ugni_module->device->dev_lock);
402401
if (OPAL_LIKELY(GNI_RC_SUCCESS != grc)) {
402+
OPAL_THREAD_UNLOCK(&ugni_module->device->dev_lock);
403403
return 0;
404404
}
405405

@@ -415,7 +415,6 @@ mca_btl_ugni_progress_datagram (mca_btl_ugni_module_t *ugni_module)
415415
}
416416

417417
/* wait for the incoming datagram to complete (in case it isn't) */
418-
OPAL_THREAD_LOCK(&ugni_module->device->dev_lock); /* TODO: may not need lock for this function */
419418
grc = GNI_EpPostDataWaitById (handle, datagram_id, -1, &post_state,
420419
&remote_addr, &remote_id);
421420
OPAL_THREAD_UNLOCK(&ugni_module->device->dev_lock);

0 commit comments

Comments
 (0)