Flagsmith / Flagsmith/flagsmith-rust-client

Analytics shutdown flush is best-effort and can be lost on process exit

Open
#58 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
8
Forks
7
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Following on from #55 / #57, the analytics thread now flushes buffered counts when its last sender drops, but nothing waits for that flush to finish.

We can fix that, however, we need to make design decisions around `AnalyticsProcessor` lifecycle to find the best place to block at. Right now, `AnalyticsProcessor` clones owned by `Flags` can outlive `Flagsmith`, which is arguably wrong.

### Options

1. Add explicit `shutdown()` on `Flagsmith` that closes the channel and joins with a bounded timeout; stop giving `Flags` an owning clone so the processor's lifetime is tied to `Flagsmith` alone.
2. Leave it best-effort and document it.
3. Something else?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the AnalyticsProcessor lifecycle and its owning clones in Flags and Flagsmith. Compare the listed shutdown and best-effort options, including channel closure and bounded joining. Done means the lifecycle decision is explicit and analytics flush behavior on process exit is reliable or deliberately documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.