Skip to content

Fix segmentation fault in concurrent execution (issue #2632) #2633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix segmentation fault in concurrent execution (issue #2632)

Description

This PR fixes a segmentation fault that occurs when using CrewAI with concurrent execution through either threading (ThreadPoolExecutor) or asyncio with Semaphores.

Changes

  • Added thread-local storage for locks in the CacheHandler class to avoid pickling issues
  • Made the Telemetry class thread-safe with thread-local locks
  • Fixed initialization of the CacheHandler in Crew class
  • Added comprehensive tests for concurrent execution

Testing

  • Added tests that specifically verify concurrent execution works with both threading and asyncio approaches
  • The tests use mocked LLMs to ensure fast and reliable testing

Related Issues

Fixes #2632

Link to Devin run: https://app.devin.ai/sessions/83f288bc1664409c9aebb45d9f6bc1aa
For: Joe Moura (joao@crewai.com)

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor Author

Closing due to inactivity for more than 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Segmentation fault (core dumped)
0 participants