Skip to content

khepri_cluster: Handle exception from trigger_election/2#369

Merged
dumbbell merged 1 commit into
v0.17.xfrom
handle-exception-from-trigger_election
Mar 12, 2026
Merged

khepri_cluster: Handle exception from trigger_election/2#369
dumbbell merged 1 commit into
v0.17.xfrom
handle-exception-from-trigger_election

Conversation

@dumbbell
Copy link
Copy Markdown
Collaborator

Why

The underlying call to gen_statem:call/3 returns errors like noproc or a timeout through an exception. We need to handle it in khepri_cluster. This was already the case when we start a Ra server, but not during a cluster expansion.

How

We use a try/catch block but we ignore the exception. That's ok because we are already in an error handling code path.

[Why]
The underlying call to `gen_statem:call/3` returns errors like `noproc`
or a timeout through an exception. We need to handle it in
`khepri_cluster`. This was already the case when we start a Ra server,
but not during a cluster expansion.

[How]
We use a try/catch block but we ignore the exception. That's ok because
we are already in an error handling code path.
@dumbbell dumbbell added this to the v0.17.6 milestone Mar 12, 2026
@dumbbell dumbbell self-assigned this Mar 12, 2026
@dumbbell dumbbell added the bug Something isn't working label Mar 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (863dde0) to head (bb92a08).
⚠️ Report is 2 commits behind head on v0.17.x.

Files with missing lines Patch % Lines
src/khepri_cluster.erl 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           v0.17.x     #369      +/-   ##
===========================================
- Coverage    90.09%   90.04%   -0.06%     
===========================================
  Files           22       22              
  Lines         3523     3525       +2     
===========================================
  Hits          3174     3174              
- Misses         349      351       +2     
Flag Coverage Δ
erlang-26 90.01% <0.00%> (+0.03%) ⬆️
erlang-27 90.01% <0.00%> (-0.06%) ⬇️
erlang-28 90.01% <0.00%> (-0.06%) ⬇️
os-ubuntu-latest 90.04% <0.00%> (+0.11%) ⬆️
os-windows-latest 90.04% <0.00%> (+0.03%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dumbbell dumbbell marked this pull request as ready for review March 12, 2026 15:00
@dumbbell dumbbell merged commit e3f5c79 into v0.17.x Mar 12, 2026
26 checks passed
@dumbbell dumbbell deleted the handle-exception-from-trigger_election branch March 12, 2026 15:00
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.

1 participant