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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.20%. Comparing base (e35b35a) to head (2e7d80f).
Report is 306 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.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.20%   -0.35%     
==========================================
  Files         180      190      +10     
  Lines       26938    28426    +1488     
  Branches    26938    28426    +1488     
==========================================
+ Hits        20353    21379    +1026     
- Misses       5366     5747     +381     
- Partials     1219     1300      +81     

☔ 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
This PR add the auto reconnect implementation for curp client, as a
workaround for hyperium/tonic#1254.

Signed-off-by: bsbds <[email protected]>
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.

2 participants