Skip to content

When use Langfuse tracing in large Documents pipeline: task_done() called too many times #1641

@Silence-Well

Description

@Silence-Well

Describe the bug
When use Langfuse tracing in large Documents pipline.

2025-04-11 14:49:08 - langfuse - WARNING - Item exceeds size limit (size: 1736099), dropping input / output / metadata of item until it fits.
2025-04-11 14:49:08 - langfuse - WARNING - Item does not have body or input/output fields, dropping item.
Exception in thread Thread-17: 
Traceback (most recent call last):
  File "/root/xxx/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/root/xxx/lib/python3.10/site-packages/langfuse/_task_manager/ingestion_consumer.py", line 246, in run
2025-04-11 14:49:08 - haystack.core.pipeline.pipeline - INFO - Running component prompt_builder
    self.upload()
  File "/root/xxx/lib/python3.10/site-packages/langfuse/_task_manager/ingestion_consumer.py", line 261, in upload
    self._ingestion_queue.task_done()
  File "/root/xxx/lib/python3.10/queue.py", line 75, in task_done   
    raise ValueError('task_done() called too many times')
ValueError: task_done() called too many times

To Reproduce
code:

        retrieval_pipeline = AsyncPipeline()
        retrieval_pipeline.add_component("tracer", LangfuseConnector("DB"))

Describe your environment (please complete the following information):

langfuse                  2.60.2
langfuse-haystack         0.10.1
haystack-ai               2.12.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions