Comment 9 for bug 541316

Revision history for this message
Jeff Hill (johill-lanl) wrote :

committed a fix

cvs diff -wb -- tcpiiu.cpp (in directory C:\hill\R3.14.dll_hell_fix\epics\base\src\ca\)
Index: tcpiiu.cpp
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/tcpiiu.cpp,v
retrieving revision 1.154.2.41
diff -u -b -w -b -r1.154.2.41 tcpiiu.cpp
--- tcpiiu.cpp 7 Jul 2009 23:47:38 -0000 1.154.2.41
+++ tcpiiu.cpp 8 Jul 2009 17:37:20 -0000
@@ -1775,8 +1775,10 @@
     }

     while ( nciu * pChan = this->createRespPend.get () ) {
- this->clearChannelRequest ( guard,
- pChan->getSID(guard), pChan->getCID(guard) );
+ // we dont yet know the server's id so we cant
+ // send a channel delete request and will instead
+ // trust that the server can do the proper cleanup
+ // when the circuit disconnects
         discIIU.installDisconnectedChannel ( guard, *pChan );
     }

@@ -1788,19 +1790,35 @@

     while ( nciu * pChan = this->subscripReqPend.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         discIIU.installDisconnectedChannel ( guard, *pChan );
         pChan->unresponsiveCircuitNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->connectedList.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         discIIU.installDisconnectedChannel ( guard, *pChan );
         pChan->unresponsiveCircuitNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->unrespCircuit.get () ) {
+ // if we know that the circuit is unresponsive
+ // then we dont send a channel delete request and
+ // will instead trust that the server can do the
+ // proper cleanup when the circuit disconnects
+ pChan->disconnectAllIO ( cbGuard, guard );
+ discIIU.installDisconnectedChannel ( guard, *pChan );
+ }
+
+ while ( nciu * pChan = this->subscripUpdateReqPend.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         discIIU.installDisconnectedChannel ( guard, *pChan );
+ pChan->unresponsiveCircuitNotify ( cbGuard, guard );
     }

     this->channelCountTot = 0u;
@@ -1816,20 +1834,18 @@
     guard.assertIdenticalMutex ( this->mutex );

     while ( nciu * pChan = this->createReqPend.get () ) {
- // with server prior to V42 IO could exit here
- pChan->disconnectAllIO ( cbGuard, guard );
         pChan->serviceShutdownNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->createRespPend.get () ) {
- pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
- pChan->getSID(guard), pChan->getCID(guard) );
+ // we dont yet know the server's id so we cant
+ // send a channel delete request and will instead
+ // trust that the server can do the proper cleanup
+ // when the circuit disconnects
         pChan->serviceShutdownNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->v42ConnCallbackPend.get () ) {
- pChan->disconnectAllIO ( cbGuard, guard );
         this->clearChannelRequest ( guard,
             pChan->getSID(guard), pChan->getCID(guard) );
         pChan->serviceShutdownNotify ( cbGuard, guard );
@@ -1837,16 +1853,31 @@

     while ( nciu * pChan = this->subscripReqPend.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         pChan->serviceShutdownNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->connectedList.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         pChan->serviceShutdownNotify ( cbGuard, guard );
     }

     while ( nciu * pChan = this->unrespCircuit.get () ) {
         pChan->disconnectAllIO ( cbGuard, guard );
+ // if we know that the circuit is unresponsive
+ // then we dont send a channel delete request and
+ // will instead trust that the server can do the
+ // proper cleanup when the circuit disconnects
+ pChan->serviceShutdownNotify ( cbGuard, guard );
+ }
+
+ while ( nciu * pChan = this->subscripUpdateReqPend.get () ) {
+ pChan->disconnectAllIO ( cbGuard, guard );
+ this->clearChannelRequest ( guard,
+ pChan->getSID(guard), pChan->getCID(guard) );
         pChan->serviceShutdownNotify ( cbGuard, guard );
     }