PostHog / PostHog/posthog-elixir

Improve retry queue and backpressure behavior

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement
Dominant language
Elixir
Stars
65
Forks
30
Avg merge
1d 16h
Merged PRs (30d)
16

Description

Summary

Improve retry queue behavior and define backpressure/overflow semantics.

Why

sdk-specs marks retry-queue and event-batcher as applicable to both client and server SDKs. Backend SDKs should retain retryable failed deliveries and make queue overflow behavior explicit.

Current status

PostHog.Sender batches by size/time, but after PostHog.API.batch/2 the sender clears state regardless of HTTP result. There is no durable/in-memory retry queue behavior for retryable failures, and no explicit full-queue/backpressure policy was found.

Python has a related queue/backpressure issue: https://github.com/PostHog/posthog-python/issues/146.

Suggested scope

  • Retain events when delivery fails with retryable network/5xx/429-style errors.
  • Drop or acknowledge non-retryable failures according to documented policy.
  • Define queue capacity and overflow behavior: drop oldest/newest vs block/backpressure.
  • Emit warnings/telemetry/metrics when events are dropped or retrying.
  • Serialize concurrent flushes and preserve FIFO best effort.
  • Add tests for success, retryable failure, non-retryable failure, and overflow.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PostHog.Sender and the PostHog.API.batch/2 call, then compare the retry-queue and event-batcher specifications linked in the issue. Define the queue, failure, overflow, concurrency, and telemetry behavior before implementing it. Done means tests cover successful delivery, retryable and non-retryable failures, and overflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.