-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
9915676
to
9dcefe1
Compare
Signed-off-by: LingKa <cnfty786@gmail.com>
Signed-off-by: LingKa <cnfty786@gmail.com>
Signed-off-by: LingKa <cnfty786@gmail.com>
9dcefe1
to
53e57c3
Compare
There was a problem hiding this 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: |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
.
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)