]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[ETC] The completion manager abstraction can hang during cleanup. The hang
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 7 Aug 2009 19:47:44 +0000 (19:47 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 7 Aug 2009 19:47:44 +0000 (19:47 +0000)
occurs when the user calls CompManagerCancel before calling CompManagerClose,
and the user is not waiting for events.  In this case, the completion manager
thread will pull the cancel request from the IO completion port and queue it
with the manager.  When CompManagerClose is called, it calls CompManagerCancel
to signal the thread to check the running state.  However, the completion
manager's event structure is still marked busy from the user's CompManagerCancel
call.

The result is that the completion manager thread does not receive the
signal to check the running flag and remains asleep.  Fix this by using a
different completion entry to signal the thread during destruction than that
used to cancel a CompManagerPoll event.

This fixes occasional hangs running dapltest with both the rdma_cm and socket
cm providers.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2336 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WOF2-1/etc/user/comp_channel.cpp

index 8b91d6cbac2e1f01b7b1c75b6bd7c3ea61cfe1ca..bdce27f98b36cd57fa12279699fc15255d874a2d 100644 (file)
@@ -102,8 +102,12 @@ err1:
 \r
 void CompManagerClose(COMP_MANAGER *pMgr)\r
 {\r
+       COMP_CHANNEL *channel;\r
+       COMP_ENTRY entry;\r
+\r
        pMgr->Run = FALSE;\r
-       CompManagerCancel(pMgr);\r
+       CompEntryInit(NULL, &entry);\r
+       PostQueuedCompletionStatus(pMgr->CompQueue, 0, (ULONG_PTR) pMgr, &entry.Overlap);\r
        WaitForSingleObject(pMgr->Thread, INFINITE);\r
        CloseHandle(pMgr->Thread);\r
 \r