diff options
author | Jeff Fearn <jfearn@redhat.com> | 2020-05-21 12:26:49 +1000 |
---|---|---|
committer | Jeff Fearn <jfearn@redhat.com> | 2020-07-17 09:27:04 +1000 |
commit | 98c8968068081a40bdf77b2533e0a4381f81dc2b (patch) | |
tree | 1e3534e355a81de8dc8f9297d292ca2a06eafaef | |
parent | Bug 1837825 - Missed CGI scripts when open sourcing (diff) | |
download | bugzilla-98c8968068081a40bdf77b2533e0a4381f81dc2b.tar.gz bugzilla-98c8968068081a40bdf77b2533e0a4381f81dc2b.tar.bz2 bugzilla-98c8968068081a40bdf77b2533e0a4381f81dc2b.zip |
Bug 1837822 - Serialization Error message should got to logs not the error list
It is already logged, killed of mail.
Change-Id: I880a5f5a74dafd3cc318750269514d0a884c66ab
-rw-r--r-- | Bugzilla/DB.pm | 7 | ||||
-rw-r--r-- | Bugzilla/Mailer.pm | 67 |
2 files changed, 1 insertions, 73 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index abed6ea0c..20b6db0e3 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -154,13 +154,6 @@ sub _handle_error { # If a serialization error happened, tell the user to try again. if ($_[0] =~ /could not serialize access due to concurrent update/) { Bugzilla->request_cache->{in_error} = 1; - mail_db_error( - 'Serialization Error', - $_[0], - (Carp::longmess((Bugzilla->dbh->{Statement} || "No query statement found"),)), - Dumper($_[1]->{ParamValues}) - ); - my $error_msg = "<pre>\n" . Carp::longmess((Bugzilla->dbh->{Statement} || "No query statement found")) diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index c6dda0179..5578d1c42 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -13,7 +13,7 @@ use warnings; use parent qw(Exporter); @Bugzilla::Mailer::EXPORT - = qw(MessageToMTA build_thread_marker generate_email mail_db_error); + = qw(MessageToMTA build_thread_marker generate_email); use Bugzilla::Constants; use Bugzilla::Error; @@ -300,61 +300,6 @@ sub send_staged_mail { } ## REDHAT EXTENSION 1276196 BEGIN -## REDHAT EXTENSION START 590893 966505 -sub mail_db_error { - my ($type, $query, $params) = @_; - - my $host - = eval { require Sys::Hostname; Sys::Hostname::hostname() } || 'undefined'; - my $stack - = eval { require Carp; Carp::longmess("stack backtrace") } || 'undefined'; - my $user = Bugzilla->user->identity || 'undefined'; - - my $token = generate_random_password(); - - my $logger = Bugzilla->logger; - $logger->debug( - "Mailing Bugzilla administrator with db error (identifier: $token)"); - - my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time); - my $subject = "Bugzilla $type - " - . sprintf( - "%4d-%02d-%02d %02d:%02d:%02d", - $year + 1900, - $mon + 1, $mday, $hour, $min, $sec - ); - - # determine how long last query ran for when it was killed - my $last_query_run_time = Bugzilla->params->{'long_query_timeout'}; - if (defined Bugzilla->request_cache->{_rh_query_history}) { - foreach my $prev (@{Bugzilla->request_cache->{_rh_query_history}}) { - $last_query_run_time -= $prev->{time}; - } - } - my $last_query_percent_of_total_time = eval { - sprintf "%5.2f%%", - $last_query_run_time / Bugzilla->params->{'long_query_timeout'} * 100; - }; - - # Send email to bugzilla owner about the problem - my $err_msg = "To: " . Bugzilla->params->{mail_errors_to} . "\n"; - $err_msg .= "From: bugzilla\@redhat.com\n"; - $err_msg .= "Subject: $subject\n\n"; - - $err_msg .= "Identifier: $token\n"; - $err_msg .= "Host: $host\n"; - $err_msg .= "Pid: $$\n"; - $err_msg .= "User: $user\n"; - $err_msg .= "Remote Address: " . remote_ip() . "\n"; - $err_msg .= "Stack Trace:\n$stack\n\n"; - - $err_msg .= "Query:\n$query\n\n"; - $err_msg .= "Params:\n$params\n\n"; - - MessageToMTA($err_msg, 1); -} -## REDHAT EXTENSION END 590893 966505 - 1; __END__ @@ -390,13 +335,3 @@ Builds header suitable for use as a threading marker in email notifications. Sends all staged messages -- called after a database transaction is committed. =back - - -=head1 B<Methods in need of POD> - -=over - -=item mail_db_error - -=back - |