Skip to content

Bug 2017743 - Errors are occurring intermittently when submitting a new job to the job queue to send email#2554

Merged
dklawren merged 4 commits intomozilla-bteam:masterfrom
dklawren:2017743
Feb 27, 2026
Merged

Bug 2017743 - Errors are occurring intermittently when submitting a new job to the job queue to send email#2554
dklawren merged 4 commits intomozilla-bteam:masterfrom
dklawren:2017743

Conversation

@dklawren
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses Bug 2017743, which involves intermittent errors when submitting jobs to the job queue for sending email. The fix implements retry logic for transient database errors and improves error messaging for users.

Changes:

  • Added retry mechanism with up to 4 attempts for job queue insertions to handle transient database errors
  • Enhanced error logging to include detailed stack traces using longmess() for debugging purposes
  • Simplified user-facing error message to remove technical details and guide users to contact administrators

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Bugzilla/JobQueue.pm Implements retry logic with detailed logging for job queue insertion failures, adds new imports for Try::Tiny, Carp, and Mojo::Util
template/en/default/global/code-error.html.tmpl Updates error message to be more user-friendly by removing technical error details and providing clear instructions to contact administrator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

use Try::Tiny;
use Type::Params qw( compile Invocant );
use Carp qw(longmess);

Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'dumper' function from Mojo::Util is imported but never used in the code. This import should be removed to keep the codebase clean.

Copilot uses AI. Check for mistakes.
@dklawren dklawren requested a review from cgsheeh February 27, 2026 02:11
for my $attempt (1 .. $max_attempts) {
try {
$retval = $self->SUPER::insert(@insert_args);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if you did return $self->SUPER::insert...; immediately here, you could avoid managing the $retval variable altogether. If you ever reach outside this for loop, you can ThrowCodeError unconditionally.

@dklawren dklawren merged commit 8dc8636 into mozilla-bteam:master Feb 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants