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

Remove unnecesary retrying on creating events #16954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eduardoj
Copy link
Member

@eduardoj eduardoj commented Oct 15, 2024

Also unifies the way database errors are reported. Fixes #16953.

This PR is the first of a group of pull requests:

  1. Remove unnecesary retrying on creating events
  2. Remove unnecesary retrying on updates of packages' issues  #16956
  3. Remove unnecesary retrying on updating a package #16957

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Oct 15, 2024
@eduardoj eduardoj force-pushed the refactoring/remove_retrying branch from 42e9597 to 1708591 Compare October 15, 2024 13:33
@eduardoj eduardoj changed the title Remove unnecesary retrying after receiving database exceptions Remove unnecesary retrying on creating events Oct 15, 2024
@eduardoj eduardoj marked this pull request as draft October 15, 2024 14:09
@eduardoj eduardoj force-pushed the refactoring/remove_retrying branch from 1708591 to 7344369 Compare October 16, 2024 11:13
@eduardoj eduardoj force-pushed the refactoring/remove_retrying branch from 7344369 to 1d8fb70 Compare January 24, 2025 11:15
@eduardoj eduardoj marked this pull request as ready for review January 24, 2025 11:15
@eduardoj
Copy link
Member Author

eduardoj commented Jan 24, 2025

After three months of tracking if a retry was triggered (see #16959), no retries were performed. The retrying code can be safely removed.

rescue StandardError => e
Airbrake.notify("Failed to create Event : #{type.inspect}: #{data} #{e}")
end
event = Event::Factory.new_from_type(type, data)
Copy link
Member

@hennevogel hennevogel Jan 24, 2025

Choose a reason for hiding this comment

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

How would you know which Airbrake.notify you look at in errbit?

Copy link
Member Author

Choose a reason for hiding this comment

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

How would you know which Airbrake.notify you look at in errbit?

In errbit we could have received three different messages, starting with:

  • 1: "Failed to create Event :"
  • 2: "Failed to update PackageIssue :"
  • 3: "Failed while running PackageUpdateIfDirtyJob:"

We only have received messages for this one: 2: "Failed to update PackageIssue :".

Now we are confident we potentially won't receive any "Failed to create Event :" messages, we don't need to identify which Airbrake.notify we need to send. That's why we remove this unnecessary code to distinguish between Aribrake.notify options.

Copy link
Member

Choose a reason for hiding this comment

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

Well that only means there was never any problem that required retrying right?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@eduardoj eduardoj Jan 24, 2025

Choose a reason for hiding this comment

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

Well that only means there was never any problem that required retrying right?

Exactly. That's why we don't need retrying.

Copy link
Member Author

@eduardoj eduardoj Jan 24, 2025

Choose a reason for hiding this comment

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

There are cases of this still in errbit...

https://errbit.opensuse.org/apps/5620ca2bdc71fa00b1000000/problems/670d2a5584bf460c5bef1380 https://errbit.opensuse.org/apps/5620ca2bdc71fa00b1000000/problems/65f2e3fa84bf4608f8817fd6

Both cases happened due to general failures with the database, affecting the whole application. Nothing that retrying in this part of the code could make a difference.

Copy link
Member

@hennevogel hennevogel Jan 27, 2025

Choose a reason for hiding this comment

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

That may be but how do you know this never saved us? You can't because every exception looks the same. But feel free to ignore me.

Copy link
Member Author

@eduardoj eduardoj Jan 27, 2025

Choose a reason for hiding this comment

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

This could have saved us in the past: we had another version/set-up of the database and the codebase was different.

Now, just describing with other words the same written in the commit body, we don't need this code to handle in a different way potential failures happening accessing the database.

Fortunately, we have the backtrace for every exception saved in Errbit. Even if they look the same, we can always know where the exceptions have been triggered.

If saving an event results in an ActiveRecord::StatementInvalid
exception, just retrying to save that event 10 times doesn't make a
difference.

Also, don't rescue from StandardError exceptions to handle them exactly
as we do in the rest of the application.
@eduardoj eduardoj force-pushed the refactoring/remove_retrying branch from 1d8fb70 to 4158b17 Compare January 24, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
2 participants