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

fix: server panics during shutdown with reporting metrics: failed to store jobs: context canceled #4228

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

atzoum
Copy link
Contributor

@atzoum atzoum commented Dec 12, 2023

Description

Processor, router & batchrouter cannot gracefully shutdown while their loops are working, since any error during the loop will lead to a panic. Thus all reporters' Report method need to honour a different context, that of the caller, and not the app's lifecycle context.

  • Not using the error index reporter's context in the error index reporter's Report method
  • Adding context in Report method, which can be different than the lifecycle context
  • Honouring this new context in all reporters

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 12, 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

@atzoum atzoum changed the base branch from master to release/v1.18.x December 12, 2023 06:48
@atzoum atzoum changed the title Fix.wrong context fix: server panics during shutdown with reporting metrics: failed to store jobs: context canceled Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5b94dba) 74.23% compared to head (c07e17a) 73.91%.

❗ Current head c07e17a differs from pull request most recent head fec2d8d. Consider uploading reports for the commit fec2d8d to get more accurate results

Additional details and impacted files
@@                 Coverage Diff                 @@
##           release/v1.18.x    #4228      +/-   ##
===================================================
- Coverage            74.23%   73.91%   -0.32%     
===================================================
  Files                  397      388       -9     
  Lines                58337    54800    -3537     
===================================================
- Hits                 43305    40505    -2800     
+ Misses               12704    11979     -725     
+ Partials              2328     2316      -12     

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

@atzoum atzoum merged commit c5cb5a8 into release/v1.18.x Dec 12, 2023
49 checks passed
@atzoum atzoum deleted the fix.wrongContext branch December 12, 2023 07:23
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