]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - use more generous timeouts
authorDylan William Hardison <dylan@hardison.net>
Fri, 28 Sep 2018 14:37:18 +0000 (10:37 -0400)
committerGitHub <noreply@github.com>
Fri, 28 Sep 2018 14:37:18 +0000 (10:37 -0400)
this makes all the mojo timeouts larger -- except for 'clients' which should be smaller because we're so synchronous. It also puts them into environmental variables so ops can tweak them.

Note some of the code has moved to the main application class to make future people less likely to not notice these values.

Bugzilla/Quantum.pm
Bugzilla/Quantum/Plugin/Glue.pm

index c64e57e137a3bfef8d25831034d9c5837616c17d..3d392c47b18f03fc6b6f49519fd1ab27ad324d06 100644 (file)
@@ -38,6 +38,34 @@ sub startup {
     $self->plugin('Bugzilla::Quantum::Plugin::BlockIP');
     $self->plugin('Bugzilla::Quantum::Plugin::BasicAuth');
 
+    # hypnotoad is weird and doesn't look for MOJO_LISTEN itself.
+    $self->config(
+        hypnotoad => {
+            proxy              => $ENV{MOJO_REVERSE_PROXY}      // 1,
+            heartbeat_interval => $ENV{MOJO_HEARTBEAT_INTERVAL} // 10,
+            heartbeat_timeout  => $ENV{MOJO_HEARTBEAT_TIMEOUT}  // 120,
+            inactivity_timeout => $ENV{MOJO_INACTIVITY_TIMEOUT} // 120,
+            workers            => $ENV{MOJO_WORKERS}            // 15,
+            clients            => $ENV{MOJO_CLIENTS}            // 10,
+            spare              => $ENV{MOJO_SPARE}              // 5,
+            listen             => [ $ENV{MOJO_LISTEN}           // 'http://*:3000' ],
+        },
+    );
+
+    # Make sure each httpd child receives a different random seed (bug 476622).
+    # Bugzilla::RNG has one srand that needs to be called for
+    # every process, and Perl has another. (Various Perl modules still use
+    # the built-in rand(), even though we never use it in Bugzilla itself,
+    # so we need to srand() both of them.)
+    # Also, ping the dbh to force a reconnection.
+    Mojo::IOLoop->next_tick(
+        sub {
+            Bugzilla::RNG::srand();
+            srand();
+            try { Bugzilla->dbh->ping };
+        }
+    );
+
     Bugzilla::Extension->load_all();
     if ( $self->mode ne 'development' ) {
         Bugzilla->preload_features();
index b9cf9268f20b87940a164ad861910dea149e3fe1..a38a12657d67a515cdcd588121051ebc4995f0f9 100644 (file)
@@ -31,28 +31,6 @@ sub register {
         }
     }
 
-    # hypnotoad is weird and doesn't look for MOJO_LISTEN itself.
-    $app->config(
-        hypnotoad => {
-            proxy => 1,
-            listen => [ $ENV{MOJO_LISTEN} ],
-        },
-    );
-
-    # Make sure each httpd child receives a different random seed (bug 476622).
-    # Bugzilla::RNG has one srand that needs to be called for
-    # every process, and Perl has another. (Various Perl modules still use
-    # the built-in rand(), even though we never use it in Bugzilla itself,
-    # so we need to srand() both of them.)
-    # Also, ping the dbh to force a reconnection.
-    Mojo::IOLoop->next_tick(
-        sub {
-            Bugzilla::RNG::srand();
-            srand();
-            try { Bugzilla->dbh->ping };
-        }
-    );
-
     $app->hook(
         before_dispatch => sub {
             my ($c) = @_;