open-feature / open-feature/rust-sdk
Providers' `shutdown()` not invoked on `api.shutdown()`
- Dominant language
- Rust
- Stars
- 51
- Forks
- 13
- Avg merge
- 3d 24m
- Merged PRs (30d)
- 3
Description
The expected behavior of the `shutdown()` API is to clear the providers from the registry, but also trigger each provider's `shutdown()` implementation before their removal. This is explained [in the README](https://github.com/open-feature/rust-sdk/blob/aa3a6fbae6d28718bf79de36f8650006d0024ca8/README.md?plain=1#L333), and it's the behavior in other OpenFeature SDKs. However, currently `shutdown()` calls `clear()` in the registry ([link](https://github.com/open-feature/rust-sdk/blob/aa3a6fbae6d28718bf79de36f8650006d0024ca8/src/api/provider_registry.rs#L76-L78)) but the providers' `shutdown()` is not called.
We have observed this when testing our own Rust provider. The consequence is that some of the providers' telemetry events were not flushed from memory at shutdown and were forever lost.
Contributor guide
Assessment
This issue has not been assessed yet.