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

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


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.