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

[Refactor]: Retry client #19

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LingKa28
Copy link
Contributor

@LingKa28 LingKa28 commented Feb 8, 2024

Please briefly answer these questions:

  • what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)

  • what changes does this pull request make?

  • are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)

@LingKa28 LingKa28 added this to the v0.1.2 milestone Feb 8, 2024
@LingKa28 LingKa28 linked an issue Feb 8, 2024 that may be closed by this pull request
4 tasks
@LingKa28 LingKa28 added the Improvement Refactor or optimization, including process, performance or something like that label Feb 8, 2024
Copy link

mergify bot commented Feb 8, 2024

⚠️ The sha of the head commit of this PR conflicts with #16. Mergify cannot evaluate rules on this PR. ⚠️

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.57%. Comparing base (e511f84) to head (53e57c3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   83.66%   83.57%   -0.09%     
==========================================
  Files          18       18              
  Lines        1120     1120              
  Branches       84       84              
==========================================
- Hits          937      936       -1     
- Misses        156      157       +1     
  Partials       27       27              

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

@LingKa28 LingKa28 force-pushed the refactor/retry-client branch from 9915676 to 9dcefe1 Compare February 16, 2024 04:13
@LingKa28 LingKa28 marked this pull request as ready for review February 21, 2024 01:12
Signed-off-by: LingKa <cnfty786@gmail.com>
Signed-off-by: LingKa <cnfty786@gmail.com>
Signed-off-by: LingKa <cnfty786@gmail.com>
@LingKa28 LingKa28 force-pushed the refactor/retry-client branch from 9dcefe1 to 53e57c3 Compare February 24, 2024 07:48
Copy link
Contributor

@Phoenix500526 Phoenix500526 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -216,6 +216,12 @@ async def fetch_cluster(self) -> FetchClusterResponse:
raise curp_err

raise CurpError(_CurpError(RpcTransport=Empty()))

def update_leader(self, leader_id: int | None, term: int) -> bool:
Copy link

Choose a reason for hiding this comment

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

It seems that there is no lock protects check_and_update_leader.

Copy link

Choose a reason for hiding this comment

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

You may add an additional lock here to protect update_leader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Refactor or optimization, including process, performance or something like that
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor]: Curp client
3 participants