Files
crewAI/tests
Devin AI 4c9abe3128 Fix thread safety issue in CrewAIEventsBus emit and register_handler methods
- Add proper locking using existing _lock mechanism in emit() method
- Add thread safety to register_handler() method
- Add comprehensive thread safety tests for concurrent event emission
- Add tests for concurrent handler registration
- Add tests for mixed concurrent operations
- Fixes issue #2991 where streaming events could get mixed between users

The emit() method now uses the existing _lock to ensure thread-safe access
to the _handlers dictionary and signal emission. This prevents race conditions
that could cause data mixing when multiple users interact with streaming
functionality simultaneously.

Resolves #2991

Co-Authored-By: João <joao@crewai.com>
2025-06-11 02:26:13 +00:00
..
2025-06-10 13:32:32 -04:00
2025-03-14 03:00:30 -03:00
2023-10-29 19:51:59 -03:00