summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Arecibo.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-03-26 07:33:54 +0100
committerByron Jones <bjones@mozilla.com>2013-03-26 07:33:54 +0100
commit7f31fde3a03881e59220e824a4ea390f65608ed9 (patch)
treeb3518a487106b031f9f7fe1c4048fac40cb07fb9 /Bugzilla/Arecibo.pm
parentf78bc351db35dd8209240eb89bbf45d69e06c0ee (diff)
downloadbugzilla-7f31fde3a03881e59220e824a4ea390f65608ed9.tar.gz
bugzilla-7f31fde3a03881e59220e824a4ea390f65608ed9.tar.xz
Bug 854769: arecibo is causing high load over short durations
Diffstat (limited to 'Bugzilla/Arecibo.pm')
-rw-r--r--Bugzilla/Arecibo.pm37
1 files changed, 6 insertions, 31 deletions
diff --git a/Bugzilla/Arecibo.pm b/Bugzilla/Arecibo.pm
index 8c3282ab7..08ff11c20 100644
--- a/Bugzilla/Arecibo.pm
+++ b/Bugzilla/Arecibo.pm
@@ -97,7 +97,7 @@ sub arecibo_should_notify {
sub arecibo_handle_error {
my $class = shift;
my @message = split(/\n/, shift);
- my $id = shift || arecibo_generate_id();
+ my $id = arecibo_generate_id();
my $is_error = $class eq 'error';
if ($class ne 'error' && $class ne 'warning') {
@@ -256,7 +256,7 @@ sub _arecibo_die_handler {
}
return if _in_eval();
-
+
# mod_perl overrides exit to call die with this string
exit if $message =~ /\bModPerl::Util::exit\b/;
@@ -274,36 +274,11 @@ sub _arecibo_die_handler {
$in_cgi_carp_die ||
($nested_error && $nested_error !~ /\bModPerl::Util::exit\b/)
) {
- my $uid = arecibo_generate_id();
- my $notified = arecibo_handle_error('error', $message, $uid);
-
- # if we aren't dying from a web page, let perl deal with it. this
- # does the right thing with respect to returning web service errors
- if (Bugzilla->error_mode != ERROR_MODE_WEBPAGE) {
- CORE::die($message);
- }
+ arecibo_handle_error('error', $message);
- # right now it's hard to determine if we've already returned a
- # content-type header, it's better to return two than none
- print "Content-type: text/html\n\n";
-
- my $maintainer = html_quote(Bugzilla->params->{'maintainer'});
- $message =~ s/ at \S+ line \d+\.\s*$//;
- $message = html_quote($message);
- $uid = html_quote($uid);
- $nested_error = html_quote($nested_error);
- print qq(
- <h1>Bugzilla has suffered an internal error</h1>
- <pre>$message</pre>
- <hr>
- <pre>$nested_error</pre>
- );
- if ($notified) {
- print qq(
- The <a href="mailto:$maintainer">Bugzilla maintainers</a> have
- been notified of this error [#$uid].
- );
- };
+ # and call the normal error management
+ # (ISE for web pages, error response for web services, etc)
+ CORE::die($message);
}
exit;
}