[asterisk-commits] gtjoseph: branch 13 r434544 - in /branches/13/main: asterisk.c loader.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 9 17:32:01 CDT 2015


Author: gtjoseph
Date: Thu Apr  9 17:31:58 2015
New Revision: 434544

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434544
Log:
loader/main: Don't set ast_fully_booted until deferred reloads are processed

Until we have a true module management facility it's sometimes necessary for one 
module to force a reload on another before its own load is complete.  If 
Asterisk isn't fully booted yet, these reloads are deferred.  The problem is 
that asterisk reports fully booted before processing the deferred reloads which 
means Asterisk really isn't quite ready when it says it is.

This patch moves the report of fully booted after the processing of the deferred 
reloads is complete.

Since the pjsip stack has the most number of related modules, I ran the 
channels/pjsip testsuite to make sure there aren't any issues.  All tests 
passed.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4604/


Modified:
    branches/13/main/asterisk.c
    branches/13/main/loader.c

Modified: branches/13/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/asterisk.c?view=diff&rev=434544&r1=434543&r2=434544
==============================================================================
--- branches/13/main/asterisk.c (original)
+++ branches/13/main/asterisk.c Thu Apr  9 17:31:58 2015
@@ -4671,10 +4671,10 @@
 		sig_alert_pipe[0] = sig_alert_pipe[1] = -1;
 	}
 
+	ast_process_pending_reloads();
+
 	ast_set_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED);
 	publish_fully_booted();
-
-	ast_process_pending_reloads();
 
 	pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
 

Modified: branches/13/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/loader.c?view=diff&rev=434544&r1=434543&r2=434544
==============================================================================
--- branches/13/main/loader.c (original)
+++ branches/13/main/loader.c Thu Apr  9 17:31:58 2015
@@ -115,6 +115,11 @@
 				      since they are here before we dlopen() any
 				   */
 
+/*!
+ * \brief Internal flag to indicate all modules have been initially loaded.
+ */
+static int modules_loaded;
+
 struct ast_module {
 	const struct ast_module_info *info;
 #ifdef REF_DEBUG
@@ -767,9 +772,7 @@
 {
 	struct reload_queue_item *item;
 
-	if (!ast_fully_booted) {
-		return;
-	}
+	modules_loaded = 1;
 
 	AST_LIST_LOCK(&reload_queue);
 
@@ -879,7 +882,7 @@
 
 	/* If we aren't fully booted, we just pretend we reloaded but we queue this
 	   up to run once we are booted up. */
-	if (!ast_fully_booted) {
+	if (!modules_loaded) {
 		queue_reload_request(name);
 		res = AST_MODULE_RELOAD_QUEUED;
 		goto module_reload_exit;




More information about the asterisk-commits mailing list