Skip to content

Retry event delivery and flush on close #23

Closed

Description

@Zaimwa9

All SDKs must deliver tracking and exposure events the same way:

  1. Retry on 408, 429, 502, 503, 504, network errors and timeouts: 3 attempts, backoff 1 s ×2 with full jitter. Drop the batch on any other status, including 500.
  2. Each events request times out after 3 s.
  3. Keep a batch that still fails buffered, ahead of newer events, for the next flush. The buffer holds 1000 events and drops the oldest when full. Only one batch is in flight at a time.
  4. On 401/403, drop the buffer, stop sending, and make tracking a no-op.
  5. flushEvents() waits for the send, including retries, and never raises. close(timeout) flushes and returns within the timeout.

Testing: SDKs send events to a fake events service in front of events. It passes requests through unless a scenario sets up responses for its environment key (a status, a dropped connection, or a hang), and reports the requests and the events it received, in order. Scenarios flush and close through SDK steps, so they don't depend on timers. Split them into two features: delivery (retry, buffer, auth) and shutdown (flush, close). Each retry scenario waits for real backoff, so keep them few.

A reference implementation is available in flagsmith-go-client, except close.

Activity

  1. changed the title [-]Deliver events with a shared retry rule[/-] [+]Retry event delivery and flush on close[/+] on Nov 10, 2026
  2. added
    openhands
    on Nov 10, 2026
  3. flagsmithsmith commented on Nov 11, 2026

    @flagsmithsmith
    Contributor

    Shipped in spec v0.8.0. SDKs are on v0.9.0 — all released.

    SDK State Pull request
    dotnet Released in v10.1.0
    elixir Released in v2.6.0
    flutter Released in v6.3.0
    go Released in v5.6.0
    ios Released in v3.12.0
    java Released in v8.5.0
    js Released in v12.5.0
    kotlin-android Released in v1.11.0
    nodejs Released in v9.4.0
    php Released in v5.4.0
    python Released in v6.6.0
    ruby Released in v5.3.0
    rust Released in v3.4.0
  4. Zaimwa9 commented on Nov 11, 2026

    @Zaimwa9
    ContributorAuthor

    The go SDK should work on #245

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    openhands

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions