Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug-1901998: fix buginfo view to stop sending sentry errors #6779

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

willkg
Copy link
Contributor

@willkg willkg commented Oct 31, 2024

When Bugzilla is in a mood, the buginfo view queries the BugInfo API and that API throws a requests.exceptions.RetryError which the buginfo view didn't handle and thus we end up with a Sentry error.

When this happens, the report view Bugzilla tab gets back an HTTP 500 from querying the buginfo view and kind of shrugs and doesn't show bug details. The user isn't really impacted--they can continue their merry day.

2024-10-31_bugzilla_tab

Bugzilla seems to be down a lot, so we get these Sentry errors we're not going to do anything with. Thus I did a couple of things:

  1. increase the backoff_factor for Bugzilla requests giving us a little more time for Bugzilla to find its happy place
  2. change the buginfo view to handle the RetryError by returning an HTTP 500 with an error message

After this, the user sees the same thing (maybe we could improve that a bit, but I'm not going to do that in this bug) and we don't get a Sentry event we're not going to do anything with.

When Bugzilla is in a mood, the buginfo view queries the BugInfo API and
that API throws a requests.exceptions.RetryError which the buginfo view
didn't handle and thus we end up with a Sentry error.

When this happens, the report view Bugzilla tab gets back an HTTP 500
from querying the buginfo view and kind of shrugs and doesn't show bug
details. The user isn't really impacted--they can continue their merry
day.

Bugzilla seems to be down a lot, so we get these Sentry errors we're not
going to do anything with. Thus I did a couple of things:

1. increase the backoff_factor for Bugzilla requests giving us a little
   more time for Bugzilla to find its happy place
2. change the buginfo view to handle the RetryError by returning an HTTP
   500 with an error message and _not_ sending a Sentry event
@willkg willkg requested a review from a team as a code owner October 31, 2024 14:37
@@ -57,7 +57,7 @@ def get_bugs_and_related_bugs(self, signatures):


class BugAssociation(models.Model):
"""Specifies assocations between bug ids in Bugzilla and signatures"""
"""Specifies associations between bug ids in Bugzilla and signatures"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set up pre-commit and it's now fixing typos before I can create commits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does that work for all local development, or is that config specific to your local development? If the former, where was that added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used it a long time ago and then decided I didn't like the way it was structured. Rehan built Therapist which I used for a while, but I think that's unmaintained now.

I noticed SRE uses pre-commit for their repositories and decided to try it out again.

https://github.com/mozilla-it/webservices-infra/blob/main/.pre-commit-config.yaml
https://github.com/mozilla/terraform-modules/blob/main/.pre-commit-config.yaml
https://github.com/mozilla-it/global-platform-admin/blob/main/.pre-commit-config.yaml

I was going to give it a little more time and then bring it up at an Observeneers meeting.

In the meantime, it's fixing spelling in PRs I'm doing in files I made a change to and I wanted to point out that's a cosmetic change.

try:
return bzapi.get(bug_ids)
except RetryError:
return {"error": "Max retries exceeded with Bugzilla."}, 500
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This return is a structure that utils.json_view recognizes and will split into "response, status".

@willkg willkg added this pull request to the merge queue Oct 31, 2024
@willkg
Copy link
Contributor Author

willkg commented Oct 31, 2024

Thank you!

Merged via the queue into main with commit d6a4fba Oct 31, 2024
1 check passed
@willkg willkg deleted the willkg-bug-1901998-bz branch October 31, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants