[asterisk-dev] [Code Review] 2561: Fix message type shutdown problems... again

David Lee reviewboard at asterisk.org
Thu May 23 09:58:51 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2561/
-----------------------------------------------------------

(Updated May 23, 2013, 9:58 a.m.)


Status
------

This change has been discarded.


Review request for Asterisk Developers.


Repository: Asterisk


Description
-------

During an immediate shutdown (in which modules are not unloaded),
there is a window of time where the core message types have been
cleaned up, but the message bus is still running. Since subscriptions
from the modules remain subscribed, any references they have to core
message types could be invalid.

This patch does two things.

First, it changes the assert in accessing a NULL message type to an
error level log message. All of the message type functions are
actually NULL safe, so the assert is a bit heavy-handed. Especially
for anyone building with DO_CRASH.

Secondly, it introduces stasis_register_atexit(), which allows the
registration of handlers that run after the message bus has been shut
down.

All message type cleanup in main/*.c was moved to Stasis atexit
handlers, so that those message types can be referred by any of the
lingering subscriptions in the message bus.


Diffs
-----

  /trunk/include/asterisk/security_events.h 389540 
  /trunk/include/asterisk/stasis.h 389540 
  /trunk/include/asterisk/stasis_bridging.h 389540 
  /trunk/include/asterisk/stasis_channels.h 389540 
  /trunk/main/app.c 389540 
  /trunk/main/asterisk.c 389540 
  /trunk/main/bridging.c 389540 
  /trunk/main/channel.c 389540 
  /trunk/main/devicestate.c 389540 
  /trunk/main/named_acl.c 389540 
  /trunk/main/presencestate.c 389540 
  /trunk/main/security_events.c 389540 
  /trunk/main/stasis.c 389540 
  /trunk/main/stasis_bridging.c 389540 
  /trunk/main/stasis_cache.c 389540 
  /trunk/main/stasis_channels.c 389540 
  /trunk/main/test.c 389540 

Diff: https://reviewboard.asterisk.org/r/2561/diff/


Testing
-------

Lots of core stop {now,gracefully} with and without channels up.


Thanks,

David Lee

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130523/cbdb0d0a/attachment.htm>


More information about the asterisk-dev mailing list