]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip: Reorder unload_module to deal with stuck TCP threads. 41/4641/2
authorCorey Farrell <git@cfware.com>
Fri, 9 Dec 2016 02:00:02 +0000 (21:00 -0500)
committerCorey Farrell <git@cfware.com>
Sat, 17 Dec 2016 16:28:20 +0000 (10:28 -0600)
commit767d569f76420c7976aa7dd113708811fe4fad8b
tree2c7e98a2c4b79e43bcffe3050e852c7335aa6f2e
parent510acb2effeb14d62853c8a5ba239b563bce8efd
chan_sip: Reorder unload_module to deal with stuck TCP threads.

In some situations TCP threads may become frozen.  This creates the
possibility that Asterisk could segfault if they become unfrozen after
chan_sip has been dlclose'd.  This reorders the unload_module process to
allow abort if threads do not exit within 5 seconds.

High level order as follows:
1) Unregister from the core to stop new requests.
2) Signal threads to stop
3) Clear config based tables (but do not free the table itself).
4) Verify that threads have shutdown, cancel unload if not.
5) Clean all remaining resources.

ASTERISK-26586

Change-Id: Ie23692041d838fbd35ece61868f4c640960ff882
channels/chan_sip.c