Files
crewAI/tests/utilities
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
..
2024-12-10 11:18:45 -05:00
2025-05-16 15:18:11 -04:00
2024-05-02 05:00:29 -03:00