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

Fixes to khepri_cluster member queries #287

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Aug 22, 2024

This pull request contains a set of patches to fix the functions to query Ra members and nodes in khepri_cluster:

  • The return value in case of a timeout was not aligned with the type spec and inconsistent with what other functions do.
  • The timeout argument may not have been honored in the case of a noproc.
  • The query was not retried after a noconnection error and a few other related errors.

[Why]
Other functions use the uniform `{error, _}` return value for errors and
already convert `{timeout, _}` term to conform to that.

The functions that query Ra members or nodes didn't do that so far, even
though the type spec said otherwise.
[Why]
Even if the time out was reached while retrying `ra:member/2` after a
`noproc` error, the code would continue to retry because it never
checked the remaining time.
... or a few other errors related to inter-node connection issues.

[Why]
We want to use the given timeout to give another chance to success.
@dumbbell dumbbell added the bug Something isn't working label Aug 22, 2024
@dumbbell dumbbell added this to the v0.15.0 milestone Aug 22, 2024
@dumbbell dumbbell self-assigned this Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.64%. Comparing base (1bc7edb) to head (dd04e04).
Report is 5 commits behind head on main.

Files Patch % Lines
src/khepri_cluster.erl 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
+ Coverage   89.62%   89.64%   +0.01%     
==========================================
  Files          21       21              
  Lines        3124     3130       +6     
==========================================
+ Hits         2800     2806       +6     
  Misses        324      324              
Flag Coverage Δ
erlang-25 88.84% <83.33%> (-0.02%) ⬇️
erlang-26 89.58% <83.33%> (+0.08%) ⬆️
erlang-27 89.55% <83.33%> (-0.02%) ⬇️
os-ubuntu-latest 89.64% <83.33%> (+0.01%) ⬆️
os-windows-latest 89.52% <33.33%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dumbbell dumbbell marked this pull request as ready for review August 22, 2024 16:26
@dumbbell dumbbell requested a review from the-mikedavis August 22, 2024 16:30
@michaelklishin michaelklishin merged commit 2e7f1b8 into main Aug 22, 2024
12 checks passed
@michaelklishin michaelklishin deleted the fixes-to-khepri_cluster-member-queries branch August 22, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants