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: add auto reconnect to curp client #972

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

bsbds
Copy link
Collaborator

@bsbds bsbds commented Aug 30, 2024

This PR includes two major changes:

  • Implements an auto reconnect layer.
  • Lazily build connections for client.

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)

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 26 lines in your changes missing coverage. Please review.

Project coverage is 75.19%. Comparing base (e35b35a) to head (3f31145).
Report is 332 commits behind head on master.

Files with missing lines Patch % Lines
crates/curp/src/rpc/reconnect.rs 86.76% 4 Missing and 5 partials ⚠️
crates/curp/src/client/unary/mod.rs 44.44% 3 Missing and 2 partials ⚠️
crates/curp/src/client/retry.rs 0.00% 0 Missing and 4 partials ⚠️
crates/curp/src/client/state.rs 84.61% 3 Missing and 1 partial ⚠️
crates/curp/src/rpc/connect.rs 95.45% 0 Missing and 2 partials ⚠️
crates/xline-client/src/lib.rs 0.00% 0 Missing and 1 partial ⚠️
crates/xline/src/server/xline_server.rs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #972      +/-   ##
==========================================
- Coverage   75.55%   75.19%   -0.36%     
==========================================
  Files         180      192      +12     
  Lines       26938    28592    +1654     
  Branches    26938    28592    +1654     
==========================================
+ Hits        20353    21500    +1147     
- Misses       5366     5797     +431     
- Partials     1219     1295      +76     

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

@bsbds bsbds marked this pull request as ready for review August 30, 2024 02:48
@mergify mergify bot requested a review from a team August 30, 2024 02:48
Copy link
Collaborator

@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.

What is the principle behind changing an async method to a sync one, or vice versa? Please squash these commits into one

crates/curp/src/rpc/connect.rs Show resolved Hide resolved
crates/curp/src/rpc/connect.rs Show resolved Hide resolved
@mergify mergify bot requested a review from a team September 9, 2024 01:08
Copy link
Collaborator

@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.

Plz squash these commits.

@mergify mergify bot requested a review from a team September 23, 2024 02:16
Copy link

mergify bot commented Oct 9, 2024

@bsbds Your PR is in conflict and cannot be merged.

@bsbds bsbds force-pushed the fix-client-connection-timeout branch from 2e7d80f to 3dc9875 Compare October 9, 2024 01:02
Copy link

mergify bot commented Oct 9, 2024

@bsbds Convert your pr to draft since CI failed

@mergify mergify bot marked this pull request as draft October 9, 2024 01:05
@mergify mergify bot added the CI:fail CI has failed label Oct 9, 2024
@bsbds bsbds force-pushed the fix-client-connection-timeout branch from 3dc9875 to fd409a5 Compare October 9, 2024 01:14
Copy link

github-actions bot commented Nov 9, 2024

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 14 days

@github-actions github-actions bot added the Stale label Nov 9, 2024
Copy link

This PR was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this Nov 23, 2024
@bsbds bsbds reopened this Dec 2, 2024
@github-actions github-actions bot removed the Stale label Dec 3, 2024
rogercloud
rogercloud previously approved these changes Dec 3, 2024
This PR add the auto reconnect implementation for curp client, as a
workaround for hyperium/tonic#1254.

Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
@bsbds bsbds force-pushed the fix-client-connection-timeout branch from 7abac81 to 0baad73 Compare December 3, 2024 05:51
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
@bsbds bsbds force-pushed the fix-client-connection-timeout branch from 0baad73 to 3f31145 Compare December 3, 2024 06:05
@bsbds bsbds marked this pull request as ready for review December 3, 2024 06:20
@mergify mergify bot requested a review from a team December 3, 2024 06:20
@mergify mergify bot requested a review from a team December 3, 2024 07:31
@bsbds bsbds merged commit 71479a4 into xline-kv:master Dec 3, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI:fail CI has failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants