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

Better error handling in backfill script #2148

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

cmurphy
Copy link
Contributor

@cmurphy cmurphy commented Jun 13, 2024

Fix error handling for backfill

  • defer the channel close so that the channel is closed no matter what
  • always report parse and insert errors
  • handle a cancelled context in the sql query
  • clean up inappropriate log.Fatal calls leftover from an earlier
    refactor
  • don't print success if insertion failed

Abort backfill after limited errors

If there is a persistent problem with one of the network connections,
continuing to attempt the insertion is a waste of time, and if the list
of errors gets too long before the script finishes or is interrupted, it
becomes impossible to tell when it started failing and therefore where
to restart the script from. This change sets a limit on the maximum
number of failures to tolerate before exiting the script. Parsing errors
are related to the format of the data and don't have implications on the
overall success of the script on other data, so no change is implemented
for parsing errors.

Summary

Release Note

Documentation

@cmurphy cmurphy requested a review from a team as a code owner June 13, 2024 22:44
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.44%. Comparing base (488eb97) to head (da72164).
Report is 143 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2148       +/-   ##
===========================================
- Coverage   66.46%   48.44%   -18.02%     
===========================================
  Files          92       80       -12     
  Lines        9258     6659     -2599     
===========================================
- Hits         6153     3226     -2927     
- Misses       2359     3035      +676     
+ Partials      746      398      -348     
Flag Coverage Δ
e2etests ?
unittests 48.44% <ø> (+0.76%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- defer the channel close so that the channel is closed no matter what
- always report parse and insert errors
- handle a cancelled context in the sql query
- clean up inappropriate log.Fatal calls leftover from an earlier
  refactor
- don't print success if insertion failed

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
If there is a persistent problem with one of the network connections,
continuing to attempt the insertion is a waste of time, and if the list
of errors gets too long before the script finishes or is interrupted, it
becomes impossible to tell when it started failing and therefore where
to restart the script from. This change sets a limit on the maximum
number of failures to tolerate before exiting the script. Parsing errors
are related to the format of the data and don't have implications on the
overall success of the script on other data, so no change is implemented
for parsing errors.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
@haydentherapper haydentherapper merged commit 3323267 into sigstore:main Jun 20, 2024
15 checks passed
@github-actions github-actions bot added this to the v1.2.2 milestone Jun 20, 2024
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