]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip: Reorder unload_module to deal with stuck TCP threads. 40/4640/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:32:14 +0000 (11:32 -0500)
commit493849dcd7224145388fac81bc791d219f17aae1
tree6cdba76c727ca7f8d6610e9c3af5762c60e8e38d
parent91485734a48e9e44292b80b8993fb464bc3817b0
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