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

TxMgr: Rearrange TxMgr closure in Batcher #9205

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

axelKingsley
Copy link
Contributor

Moves the TxManager.Close to be the first in BatcherService.Close.

This is done because the TxManager now aggressively shuts down work when in the Close state, and declines new work, leading to a faster shutdown of the component. However, BatcherService was treating TxManager too gently, waiting for work to be finished before ever asking it to shut down.

The end result was that the Batcher did not benefit from the faster Closure of TxManager.

By making TxManager closure the first call, any component which awaits TxManager completion will be satisfied much sooner.

Testing

Not tested besides auto-checks here in the PR.

@axelKingsley axelKingsley requested a review from a team as a code owner January 26, 2024 19:00
@axelKingsley axelKingsley requested a review from tynes January 26, 2024 19:00
Copy link
Contributor

coderabbitai bot commented Jan 26, 2024

Walkthrough

Walkthrough

The update improves the BatcherService's Stop method by closing the TxManager before stopping the batch submission process. This change ensures that new work is denied and in-flight work is canceled as early as possible. Additionally, it enhances error handling for closing the balance metricer and the metrics service, contributing to a more robust and reliable service shutdown procedure.

Changes

File Path Change Summary
op-batcher/batcher/service.go Updated the Stop method to close the TxManager first, ensuring early denial of new work and cancellation of in-flight work. Enhanced error handling for closing the balance metricer and metrics service.

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 your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@trianglesphere trianglesphere added this pull request to the merge queue Jan 26, 2024
@trianglesphere trianglesphere removed this pull request from the merge queue due to a manual request Jan 26, 2024
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

excited to test this in action ✨

@sebastianst sebastianst added this pull request to the merge queue Jan 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 29, 2024
Copy link
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

Hopefully this fixes flakes

@tynes tynes added this pull request to the merge queue Jan 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 29, 2024
@trianglesphere trianglesphere added this pull request to the merge queue Jan 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 29, 2024
@trianglesphere trianglesphere added this pull request to the merge queue Jan 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 30, 2024
@axelKingsley axelKingsley force-pushed the chore/earlierTxMgrClose branch from 692f6ad to 1abba7f Compare January 30, 2024 00:49
@trianglesphere trianglesphere added this pull request to the merge queue Jan 30, 2024
Merged via the queue into develop with commit 94fc9d3 Jan 30, 2024
65 checks passed
@trianglesphere trianglesphere deleted the chore/earlierTxMgrClose branch January 30, 2024 01:51
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.

4 participants