-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
backlogWe've confirmed some action is needed on this and will plan itWe've confirmed some action is needed on this and will plan itbugSomething isn't workingSomething isn't workingv3Issues that we know should be closed with the v3 release in late 2025.Issues that we know should be closed with the v3 release in late 2025.
Description
Do you need to file an issue?
- I have searched the existing issues and this bug is not already filed.
- My model is hosted on OpenAI or Azure. If not, please look at the "model providers" issue and don't file a new one here.
- I believe this is a legitimate bug, not just a question. If this is a question, please use the Discussions area.
Describe the bug
Description:
GraphRAG fails in Celery worker processes with RuntimeError: threads can only be started once when executing queries that use embedding models.
Root Cause
The run_coroutine_sync() function in graphrag/language_model/providers/fnllm/utils.py is not fork-safe. When Celery creates worker processes by forking:
- Process Fork: Celery forks the main process to create workers
- Thread Inheritance: Child processes inherit parent's global thread objects (
_thr,_loop,_pid) - Dead Threads: Inherited thread objects exist but the actual threads are not running
- Restart Failure: Code attempts to call
_thr.start()on a dead thread object - Runtime Error: Python raises "threads can only be started once" because threads have single-use lifecycle
Additional Files to Reference:
graphrag/language_model/providers/fnllm/utils.py(lines 112-134)graphrag/language_model/providers/fnllm/models.py(whererun_coroutine_syncis called)
Impact:
- GraphRAG queries fail in Celery workers
- Any async operation using FNLLM models crashes
- Production deployments using Celery are broken
Steps to reproduce
Expected Behavior
No response
GraphRAG Config Used
No Changes in Config
Logs and screenshots
No response
Additional Information
- GraphRAG Version: 2.3.0
- Operating System: Windows
- Python Version: 3.11
- Related Issues:
Metadata
Metadata
Assignees
Labels
backlogWe've confirmed some action is needed on this and will plan itWe've confirmed some action is needed on this and will plan itbugSomething isn't workingSomething isn't workingv3Issues that we know should be closed with the v3 release in late 2025.Issues that we know should be closed with the v3 release in late 2025.