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

chore: autofix corrupted job-status stats #4224

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

atzoum
Copy link
Contributor

@atzoum atzoum commented Dec 11, 2023

Description

Whenever corrupted job-status stats are encountered (in < out), gateway fixes them before responding and logs a warning.

Linear Ticket

resolves PIPE-617

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Copy link
Contributor

coderabbitai bot commented Dec 11, 2023

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment from CodeRabbit.
  • You can also chat with CodeRabbit bot directly around the specific lines of code or files in the PR by tagging @coderabbitai in a new comment.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json


func (r *Stats) fixCorrupted() {
if r.corrupted() {
r.In = r.Out + r.Failed
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason behind this corruption? Why are we programatically fixing this corruption?

Copy link
Contributor Author

@atzoum atzoum Dec 11, 2023

Choose a reason for hiding this comment

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

This doesn't happen regularly, however there are some pretty rare occasions where server bugs can cause this kind of corruption (example).

The idea here is to "fix" this corruption virtually for the consuming service to resume without other teams being alerted and fire an alert on our side so that we can further investigate. The alert would be setup on the new warning log.

@atzoum atzoum force-pushed the chore.rsourcesStatsInconsistencies branch from 3f6e02a to 88084d9 Compare December 12, 2023 07:19
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (68e52d5) 73.79% compared to head (14b3216) 73.81%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4224      +/-   ##
==========================================
+ Coverage   73.79%   73.81%   +0.01%     
==========================================
  Files         388      388              
  Lines       54800    54834      +34     
==========================================
+ Hits        40440    40476      +36     
+ Misses      12038    12034       -4     
- Partials     2322     2324       +2     

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

@atzoum atzoum requested a review from mihir20 December 12, 2023 07:39
@atzoum atzoum force-pushed the chore.rsourcesStatsInconsistencies branch from 88084d9 to 14b3216 Compare December 12, 2023 07:55
@atzoum atzoum merged commit 781f24f into master Dec 12, 2023
41 checks passed
@atzoum atzoum deleted the chore.rsourcesStatsInconsistencies branch December 12, 2023 09:42
This was referenced Jan 15, 2024
This was referenced Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants