Files
crewAI/lib/crewai/tests
Devin AI 703e0f6191 fix: memory leak in execution_spans dictionary
Fix memory leak in EventListener where completed/failed tasks were never
fully removed from the execution_spans dictionary. Instead of removing
entries, the code was setting them to None, causing task objects to
remain referenced indefinitely and preventing garbage collection.

Changes:
- Replace 'self.execution_spans[source] = None' with
  'self.execution_spans.pop(source, None)' in both TaskCompletedEvent
  and TaskFailedEvent handlers
- Add comprehensive tests to verify execution_spans cleanup behavior

This fixes unbounded memory growth in long-running processes or systems
executing many tasks.

Fixes #4222

Co-Authored-By: João <joao@crewai.com>
2026-01-12 06:16:23 +00:00
..
2026-01-05 15:30:21 -08:00
2025-10-20 14:10:19 -07:00
2025-12-04 16:53:19 -05:00
2025-12-04 12:54:49 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-04 13:34:29 -08:00
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-12-04 17:08:08 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00