< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] Sometimes sip stack looses outgoing messages before shutting down.


Looks like your shutdown order isn't quite correct.  Take a look at how shutdown works in the basicClient example in dum/test directory.  Some other information on shutting down Dum itself is here:  https://www.resiprocate.org/DUM_Application_Shutdown

Basically you should shut DUM down entirely first, then only shutdown the stack after dum is shutdown.

Scott


On Fri, Jun 13, 2014 at 3:38 AM, palladin <p-aladin@xxxxxxxxx> wrote:
Dear resip devels,
resiprocate 1.9.2

Could you please advise with small issue?

There is an application with the next architecture:
-main thread,which processes start,stop,signals.
-DUM thread.
-all other SipStack stuff.

When application is shutting down it makes next steps:
-sends a few "final messages",using resip::ServerSubscriptionHandle.
-resip::EventStackThread::shutdown
-SipStack::shutdownAndJoinThreads
-DumThread::shutdown
-joins all threads above.

Sometimes,described above, "final message" does not leave SipStack. I can observe in application log message: TransportSelector.cxx:1185:Transmitting to [ ... ], but SipMessage does not leave Transport. Tcpdump points that given message did not pass through the network interface.
I can assume only, that SipMessage was inserted into InternalTransport::mTxFifo after call to TransportSelectorThread::shutdown and UdpTreansport did not updated FdPollGrp.

Could you please advise, if there is any sense to run post shutdown iteration inside TransportSelectorThread? For example:
--- a/resip/stack/TransportSelectorThread.hxx
+++ b/resip/stack/TransportSelectorThread.hxx
@@ -42,6 +42,9 @@ class TransportSelectorThread : public ThreadIf
                ErrLog(<< "Unhandled exception: " << e);
             }
          }
+
+        mSelector.process();
+        mPollGrp->waitAndProcess(25);
       }

Or there might be more accurate steps to shutdown SipStack and to send all outgoing stuff?

Sincerely,tez.
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@resiprocate.org
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel