PostHog / PostHog/posthog-python
Backpressure when queue is full
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 61
- Forks
- 82
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 71
Description
We uncovered a case where a key customer was losing events due to the way this library is configured/built.
With the flush_interval=2 (default is 0.5), flush_at=100 and max_queue_size=1000 (default 10k), their queue got full during peak hours and they started dropping events.
Their recommended solution is very reasonable:
Ideally the library would provide back pressure by blocking/waiting for acknowledgement when flushing a batch of events vs having to configure a max_queue_size.
We should implement some way to block when the queue is full, or some way to let the user know the queue size.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by tracing how flush_interval, flush_at, and max_queue_size control event delivery, then clarify whether the intended behavior is blocking on a full queue or exposing its size. Done should include a defined queue-full behavior and coverage for the reported event-loss case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100