summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2016-03-10 16:58:49 -0600
committerMark Michelson <mmichelson@digium.com>2016-03-24 16:59:24 -0500
commit89e94e886c8d2a3bf31eae50d838afc2c26906f9 (patch)
treecad5c660e96b3cfb620acf6d9c2485023f52044c /main/utils.c
parent894071ea2cedcc65e452cabfe3cd805daf5a6a1d (diff)
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
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c
index 8a9f91062..6a778b90c 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1153,6 +1153,7 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_
"Usage: core show locks\n"
" This command is for lock debugging. It prints out which locks\n"
"are owned by each active thread.\n";
+ ast_cli_allow_on_shutdown(e);
return NULL;
case CLI_GENERATE: