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

fix(ffi): prevent fatal error if there is the connection error during client creation #204

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

erka
Copy link
Collaborator

@erka erka commented Mar 27, 2024

Sooner or later this should be fixed.

thread '<unnamed>' panicked at flipt-engine-ffi/src/lib.rs:205:74:
called `Result::unwrap()` on an `Err` value: Server("failed to make request: error sending request for url (http://localhost:8080/internal/v1/evaluation/snapshot/namespace/default)")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
SIGABRT: abort

The idea is to start with empty state and use replace_snapshot logic to fill it. If the service isn't available the error will be returned until the service is live and state is updated.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 84.26%. Comparing base (3f7831c) to head (dbd591a).

Files Patch % Lines
flipt-engine-ffi/src/evaluator/mod.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
- Coverage   84.28%   84.26%   -0.03%     
==========================================
  Files          10       10              
  Lines        3049     3050       +1     
==========================================
  Hits         2570     2570              
- Misses        479      480       +1     

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

@erka erka marked this pull request as ready for review March 27, 2024 17:43
@erka erka requested a review from a team as a code owner March 27, 2024 17:43
Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea

@kodiakhq kodiakhq bot merged commit e2c3e05 into flipt-io:main Mar 27, 2024
8 checks passed
@flipt-release-bot flipt-release-bot bot mentioned this pull request Mar 27, 2024
@erka erka deleted the handle-no-connection branch March 27, 2024 18:30
@erka
Copy link
Collaborator Author

erka commented Mar 27, 2024

related to #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants