Restrict CLI/AMI commands on shutdown.
authorMark Michelson <mmichelson@digium.com>
Thu, 10 Mar 2016 22:58:49 +0000 (16:58 -0600)
committerMark Michelson <mmichelson@digium.com>
Thu, 24 Mar 2016 21:59:24 +0000 (16:59 -0500)
commit89e94e886c8d2a3bf31eae50d838afc2c26906f9
treecad5c660e96b3cfb620acf6d9c2485023f52044c
parent894071ea2cedcc65e452cabfe3cd805daf5a6a1d
Restrict CLI/AMI commands on shutdown.

During stress testing, we have frequently seen crashes occur because a
CLI or AMI command attempts to access information that is in the process
of being destroyed.

When addressing how to fix this issue, we initially considered fixing
individual crashes we observed. However, the changes required to fix
those problems would introduce considerable overhead to the nominal
case. This is not reasonable in order to prevent a crash from occurring
while Asterisk is already shutting down.

Instead, this change makes it so AMI and CLI commands cannot be executed
if Asterisk is being shut down. For AMI, this is absolute. For CLI,
though, certain commands can be registered so that they may be run
during Asterisk shutdown.

ASTERISK-25825 #close

Change-Id: I8887e215ac352fadf7f4c1e082da9089b1421990
include/asterisk/cli.h
main/asterisk.c
main/cli.c
main/manager.c
main/utils.c