flipt-io/flipt-client-sdks

[FLI-861] Try to handle panics in engine

markphelps opened this issue · 2 comments

thread '<unnamed>' panicked at flipt-engine-ffi/src/lib.rs:212:79:

Thank you @markphelps, that helps to understand the issue better. That unwrap could panic in many cases if there is an connection or configuration issue. It would be great if initialize_engine could return an error to upstream instead of panic. Don't know if that is possible with FFI.

Yeah agreed. We should see if we can recover from panic in FFI/Flipt Evaluation layer and always return an error instead of crashing the client. Will create an issue for this in the flipt-client-sdk repo

Originally posted by @markphelps in flipt-io/flipt#2791 (comment)

FLI-861

This from the stdlib may be helpful per the Rust FFI docs: https://doc.rust-lang.org/nomicon/ffi.html#catching-panic-preemptively