Skip to content

Flush never completes if too large of item is submitted #308

@masenf

Description

@masenf
import os
from posthog import Posthog

POSTHOG_API_KEY = os.environ["POSTHOG_API_KEY"]

posthog = Posthog(POSTHOG_API_KEY, host="https://us.i.posthog.com")
posthog.capture_exception(
    Exception("Test Exception"),
    properties={
        "user_id": "123",
        "context": "test"
    }
)
posthog.flush()
print("Flushed first exception")

posthog.capture_exception(
    Exception("1234567890" * 90000),
    properties={
        "user_id": "123",
        "context": "test"
    }
)
posthog.flush()                     # <----- hangs here
print("Flushed second exception")

The consumer code needs to mark self.queue.task_done() when discarding items that are too large.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions