You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2013/07/26 23:50:15 UTC

git commit: TS-1487: More startup order tweaking, based on reported crash.

Updated Branches:
  refs/heads/master 95c8f3893 -> 6a70e5abf


TS-1487: More startup order tweaking, based on reported crash.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6a70e5ab
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6a70e5ab
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6a70e5ab

Branch: refs/heads/master
Commit: 6a70e5abf4de28636414896f97312c645625fdae
Parents: 95c8f38
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Fri Jul 26 16:49:44 2013 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Fri Jul 26 16:49:44 2013 -0500

----------------------------------------------------------------------
 proxy/Main.cc | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6a70e5ab/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index e9c281c..438242e 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -1559,12 +1559,19 @@ main(int /* argc ATS_UNUSED */, char **argv)
     SplitDNSConfig::startup();
 #endif
 
+    // Load HTTP port data. getNumSSLThreads depends on this.
+    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
+      HttpProxyPort::loadConfig();
+    HttpProxyPort::loadDefaultIfEmpty();
 
     if (!accept_mss)
       TS_ReadConfigInteger(accept_mss, "proxy.config.net.sock_mss_in");
 
     NetProcessor::accept_mss = accept_mss;
     netProcessor.start(0, stacksize);
+
+    sslNetProcessor.start(getNumSSLThreads(), stacksize);
+
 #ifndef INK_NO_HOSTDB
     dnsProcessor.start(0, stacksize);
     if (hostDBProcessor.start() < 0)
@@ -1575,15 +1582,15 @@ main(int /* argc ATS_UNUSED */, char **argv)
     clusterProcessor.init();
 #endif
 
-    // Plugins can get callbacks for very early events, so initialize even earlier.
+#ifndef INK_NO_LOG
+    // initialize logging (after event and net processor)
+    Log::init(remote_management_flag ? 0 : Log::NO_REMOTE_MANAGEMENT);
+#endif
+
+    // Init plugins as soon as logging is ready.
     plugin_init(system_config_directory);        // plugin.config
     pmgmt->registerPluginCallbacks(global_config_cbs);
 
-    // Load HTTP port data. getNumSSLThreads depends on this.
-    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
-      HttpProxyPort::loadConfig();
-    HttpProxyPort::loadDefaultIfEmpty();
-
     cacheProcessor.set_after_init_callback(&CB_After_Cache_Init);
     cacheProcessor.start();
 
@@ -1593,13 +1600,6 @@ main(int /* argc ATS_UNUSED */, char **argv)
     if (num_of_udp_threads)
       udpNet.start(num_of_udp_threads, stacksize);
 
-    sslNetProcessor.start(getNumSSLThreads(), stacksize);
-
-#ifndef INK_NO_LOG
-    // initialize logging (after event and net processor)
-    Log::init(remote_management_flag ? 0 : Log::NO_REMOTE_MANAGEMENT);
-#endif
-
     //acc.init();
     //if (auto_clear_authdb_flag)
      // acc.clear_cache();


Re: git commit: TS-1487: More startup order tweaking, based on reported crash.

Posted by James Peach <ja...@me.com>.
On Jul 27, 2013, at 2:30 PM, Leif Hedstrom <zw...@apache.org> wrote:

> On 7/27/13 2:40 PM, Igor Galić wrote:
>> 
>> 
>> initialize even earlier.
>> +#ifndef INK_NO_LOG
>> again one of those options that's from TS_IS_MICRO_BUILD
> 
> I personally think we should kill the MICRO_BUILD... Heck, even on my rinky dink Raspberry Pi, the normal build works just fine. I rather have us optimize our code such that the normal build works well everywhere :).

Yeh I wanted to kill it to. Next time I'm just gong to kill it unless someone ponies up a patch

J

Re: git commit: TS-1487: More startup order tweaking, based on reported crash.

Posted by Leif Hedstrom <zw...@apache.org>.
On 7/27/13 2:40 PM, Igor Galić wrote:
>
>
> initialize even earlier.
> +#ifndef INK_NO_LOG
> again one of those options that's from TS_IS_MICRO_BUILD

I personally think we should kill the MICRO_BUILD... Heck, even on my 
rinky dink Raspberry Pi, the normal build works just fine. I rather have 
us optimize our code such that the normal build works well everywhere :).

-- Leif


Re: git commit: TS-1487: More startup order tweaking, based on reported crash.

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Updated Branches:
>   refs/heads/master 95c8f3893 -> 6a70e5abf
> 
> 
> TS-1487: More startup order tweaking, based on reported crash.
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6a70e5ab/proxy/Main.cc
> ----------------------------------------------------------------------
> diff --git a/proxy/Main.cc b/proxy/Main.cc
> index e9c281c..438242e 100644
> --- a/proxy/Main.cc
> +++ b/proxy/Main.cc
> @@ -1559,12 +1559,19 @@ main(int /* argc ATS_UNUSED */, char **argv)
>      SplitDNSConfig::startup();
>  #endif
>  
> +    // Load HTTP port data. getNumSSLThreads depends on this.
> +    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
> +      HttpProxyPort::loadConfig();
> +    HttpProxyPort::loadDefaultIfEmpty();
>  
>      if (!accept_mss)
>        TS_ReadConfigInteger(accept_mss,
>        "proxy.config.net.sock_mss_in");
>  
>      NetProcessor::accept_mss = accept_mss;
>      netProcessor.start(0, stacksize);
> +
> +    sslNetProcessor.start(getNumSSLThreads(), stacksize);
> +
>  #ifndef INK_NO_HOSTDB
>      dnsProcessor.start(0, stacksize);
>      if (hostDBProcessor.start() < 0)
> @@ -1575,15 +1582,15 @@ main(int /* argc ATS_UNUSED */, char **argv)
>      clusterProcessor.init();
>  #endif
>  
> -    // Plugins can get callbacks for very early events, so
> initialize even earlier.
> +#ifndef INK_NO_LOG

again one of those options that's from TS_IS_MICRO_BUILD

I'm understand there's people out there who don't want logging, but
isn't the easiest way to achieve that to simply have that around the
logging functions themselves / or turning them into macros that evaluate
to nothingness?

Rather than have this (potentially) incomplete mess that we have here.

> +    // initialize logging (after event and net processor)
> +    Log::init(remote_management_flag ? 0 :
> Log::NO_REMOTE_MANAGEMENT);
> +#endif
> +
> +    // Init plugins as soon as logging is ready.
>      plugin_init(system_config_directory);        // plugin.config
>      pmgmt->registerPluginCallbacks(global_config_cbs);
>  
> -    // Load HTTP port data. getNumSSLThreads depends on this.
> -    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
> -      HttpProxyPort::loadConfig();
> -    HttpProxyPort::loadDefaultIfEmpty();
> -
>      cacheProcessor.set_after_init_callback(&CB_After_Cache_Init);
>      cacheProcessor.start();
>  
> @@ -1593,13 +1600,6 @@ main(int /* argc ATS_UNUSED */, char **argv)
>      if (num_of_udp_threads)
>        udpNet.start(num_of_udp_threads, stacksize);
>  
> -    sslNetProcessor.start(getNumSSLThreads(), stacksize);
> -
> -#ifndef INK_NO_LOG
> -    // initialize logging (after event and net processor)
> -    Log::init(remote_management_flag ? 0 :
> Log::NO_REMOTE_MANAGEMENT);
> -#endif
> -
>      //acc.init();
>      //if (auto_clear_authdb_flag)
>       // acc.clear_cache();
> 
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Re: git commit: TS-1487: More startup order tweaking, based on reported crash.

Posted by James Peach <ja...@me.com>.
If startup ordering is so sensitive, is there a way to write unit tests for it, or some judicious assertions we can apply?

On Jul 26, 2013, at 2:50 PM, amc@apache.org wrote:

> Updated Branches:
>  refs/heads/master 95c8f3893 -> 6a70e5abf
> 
> 
> TS-1487: More startup order tweaking, based on reported crash.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6a70e5ab
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6a70e5ab
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6a70e5ab
> 
> Branch: refs/heads/master
> Commit: 6a70e5abf4de28636414896f97312c645625fdae
> Parents: 95c8f38
> Author: Alan M. Carroll <am...@network-geographics.com>
> Authored: Fri Jul 26 16:49:44 2013 -0500
> Committer: Alan M. Carroll <am...@network-geographics.com>
> Committed: Fri Jul 26 16:49:44 2013 -0500
> 
> ----------------------------------------------------------------------
> proxy/Main.cc | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6a70e5ab/proxy/Main.cc
> ----------------------------------------------------------------------
> diff --git a/proxy/Main.cc b/proxy/Main.cc
> index e9c281c..438242e 100644
> --- a/proxy/Main.cc
> +++ b/proxy/Main.cc
> @@ -1559,12 +1559,19 @@ main(int /* argc ATS_UNUSED */, char **argv)
>     SplitDNSConfig::startup();
> #endif
> 
> +    // Load HTTP port data. getNumSSLThreads depends on this.
> +    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
> +      HttpProxyPort::loadConfig();
> +    HttpProxyPort::loadDefaultIfEmpty();
> 
>     if (!accept_mss)
>       TS_ReadConfigInteger(accept_mss, "proxy.config.net.sock_mss_in");
> 
>     NetProcessor::accept_mss = accept_mss;
>     netProcessor.start(0, stacksize);
> +
> +    sslNetProcessor.start(getNumSSLThreads(), stacksize);
> +
> #ifndef INK_NO_HOSTDB
>     dnsProcessor.start(0, stacksize);
>     if (hostDBProcessor.start() < 0)
> @@ -1575,15 +1582,15 @@ main(int /* argc ATS_UNUSED */, char **argv)
>     clusterProcessor.init();
> #endif
> 
> -    // Plugins can get callbacks for very early events, so initialize even earlier.
> +#ifndef INK_NO_LOG
> +    // initialize logging (after event and net processor)
> +    Log::init(remote_management_flag ? 0 : Log::NO_REMOTE_MANAGEMENT);
> +#endif
> +
> +    // Init plugins as soon as logging is ready.
>     plugin_init(system_config_directory);        // plugin.config
>     pmgmt->registerPluginCallbacks(global_config_cbs);
> 
> -    // Load HTTP port data. getNumSSLThreads depends on this.
> -    if (!HttpProxyPort::loadValue(http_accept_port_descriptor))
> -      HttpProxyPort::loadConfig();
> -    HttpProxyPort::loadDefaultIfEmpty();
> -
>     cacheProcessor.set_after_init_callback(&CB_After_Cache_Init);
>     cacheProcessor.start();
> 
> @@ -1593,13 +1600,6 @@ main(int /* argc ATS_UNUSED */, char **argv)
>     if (num_of_udp_threads)
>       udpNet.start(num_of_udp_threads, stacksize);
> 
> -    sslNetProcessor.start(getNumSSLThreads(), stacksize);
> -
> -#ifndef INK_NO_LOG
> -    // initialize logging (after event and net processor)
> -    Log::init(remote_management_flag ? 0 : Log::NO_REMOTE_MANAGEMENT);
> -#endif
> -
>     //acc.init();
>     //if (auto_clear_authdb_flag)
>      // acc.clear_cache();
>